LoginLogin

P3D Learning Thread

Root / Programming Questions / [.]

randoCreated:
Here we learn how to use Bugtaro's P3D engine. After we reach a point where we can make quality things easily with it, a resource can be made. This thread is for sharing discoveries and asking questions. Currently, I am studying the engine to gain knowledge. You can too. I have learned the basic script for loading a model: I got this from the part of the engine where it shows off the logo using models. Code Documentation Here I will document commands and what they do. Hooray!
P3D_CMTX_DRAW_MODEL ARR[]
This simply draws a model based on the data that the user inputs.
CMTX_TRANSLATE X,Y,Z
This moves models around. If you call >1 of P3D_CMTX_DRAW_MODEL before calling CMTX_TRANSLATE again, it'll move all of the models you're about to draw. If you call this between 2 of P3D_CMTX_DRAW_MODEL, they'll move seperately. Example:
CMTX_SET_ROT_X RAD(-K#)
MTX_SET_ROT_Y RAD(-K#*4),RM
CMTX_MUL RM
CMTX_TRANSLATE X*J#,Y*J#,Z
P3D_CMTX_DRAW_MODEL ARR

CMTX_SET_ROT_X RAD(-K#)
MTX_SET_ROT_Y RAD(-K#*4),RM
CMTX_MUL RM
CMTX_TRANSLATE X2*J#,Y2*J#,Z2
P3D_CMTX_DRAW_MODEL ARR
This changes the position of the 2 models, and they don't have to go to the same place.
CMTX_SET_ROT_X RAD(-K#)
MTX_SET_ROT_Y RAD(-K#*4),RM
CMTX_MUL RM
CMTX_TRANSLATE X*J#,Y*J#,Z
P3D_CMTX_DRAW_MODEL ARR
P3D_CMTX_DRAW_MODEL ARR2
This will move both to the same place. These are the only commands that I know right now.

W