Ok well there aren't much resources or tutorials to make stages but I will try to explain very roughly.
Building 3D stages in Touhou is like building a cardboard house. Your sprites are your piece of cards and you're "placing them" in 3D in your field. This is how X Y and Z will work for a 3D environment.
[attach=1]
Let's try to first make a floor in 3D. Very very simple:
// Load your texture
let floorTex = etc...;
@Initialize {
renderStage;
}
@MainLoop { yield; }
@Finalize { }
// Your sprite, placed in 3D
function makePanel(posX,posY,posZ,angleX,angleY,angleZ) {
let obj = ObjPrim_Create(OBJ_SPRITE_3D); // <----- Very important to create as 3D sprite!
ObjPrim_SetTexture(obj,floorTex);
Obj_SetRenderPriorityI(obj,20);
ObjRender_SetBlendType(obj,BLEND_ALPHA);
ObjRender_SetAlpha(obj,255);
ObjRender_SetScaleXYZ(obj,1,1,0);
ObjSprite3D_SetSourceDestRect(obj,0,0,512,512);
ObjSprite3D_SetBillboard(obj,false);
ObjRender_SetPosition(obj,posX,posY,posZ);
ObjRender_SetAngleXYZ(obj,angleX,angleY,angleZ);
}
// Main rendering
task renderStage {
// Required to let the engine draw past default 2048. If you make a long stage which has for example textures of 4096 or longer, you need to increase the value.
SetCameraPerspectiveClip(10,4096);
// Camera settings.
SetCameraFocusX(0);
SetCameraFocusY(0);
SetCameraFocusZ(0);
SetCameraAzimuthAngle(0);
SetCameraElevationAngle(16);
// Make a panel at X Y Z position 0 (centre) and flipped around X 90 degrees (floor)
makePanel(0,0,0,90,0,0);
}
ObjPrim_Create(OBJ_SPRITE_3D); is most important code here, because otherwise it won't listen to 3D functions.
ObjSprite3D_SetSourceDestRect Note how the function name contains 3D! On the wiki you can find many functions special for 3D.
ObjSprite3D_SetBillboard Prevents the sprite from "always facing the camera" if you turn the camera around.
The way I set my cameras gives you a slight overhead view of the floor. Play around with the values to discover how the camera works. This is very important for your 3D stage.
So why did I use function makePanel() ?
I am passing 6 parameters to my 3D sprite to flexible create it. This means I can just type the same code over and create multiple walls/floors/ceilings. Otherwise if you want to make 2 floors or 4 walls, you need to type the whole code 4x. This is why functions and parameters are useful.
Try to get the above right and see if you can summon a simple floor. Good luck.