kupo15
Member
I've wanted to dabble into 3D a little bit and understand the basics of working in it for the most part. I'm having a bit of trouble grasping some concepts with models though. Are you able to rotate primatives during the model creation process or are the d3d_rotation functions only able to be used when drawing? For example this isn't rotating the cylinder to form a crossbar
Secondly with this, I purposely offset the crossbar's z axis instead of centering it as you can see by the 0's in the Z slot. I assume this is how it will allow me to rotate it at the end or should I be setting up my models always centered and shift the origin for rotation another way?
Code:
// Create
net_model = d3d_model_create();
d3d_model_cylinder(net_model,-80,-2.5,75,-75,2.5,0,1,1,true,20); // left post
d3d_transform_set_rotation_z(90)
d3d_model_cylinder(net_model,-20,-2.5,160,-15,2.5,0,1,1,true,20); // cross bar
d3d_transform_set_rotation_z(0)
d3d_model_cylinder(net_model,75,-2.5,75,80,2.5,0,1,1,true,20); // right post
// draw
d3d_model_draw(net_model,x,y,z,-1);
Last edited: