N
Ninnin
Guest
Hi all !
I'll probably ask a stupid question, but i can't make a function works...
I want to draw a line between 2 points in a 3D environnement.
A part of my function is here:
Point of origin is x,y,z and target is ... the target point
This don't work, the lines (cylinders) are not pointed to the target.
Does anyone here has a function to make this works ? Thanks
I'll probably ask a stupid question, but i can't make a function works...
I want to draw a line between 2 points in a 3D environnement.
A part of my function is here:
Code:
d3d_transform_set_identity();
draw_set_color(color);
d3d_transform_add_rotation_y(-90); //place to 0,0,0
var angleZ = point_direction(x, y, target.x, target.y);
var angleY = point_direction(y, z, target.y, target.z);
var angleX = point_direction(x, z, target.x, target.z);
d3d_transform_add_rotation_z(angleZ);
d3d_transform_add_rotation_x(angleX);
d3d_transform_add_rotation_y(angleY);
d3d_transform_add_translation(x,y,z);d3d_draw_cylinder(0,0,0,1,1,2000,-1,1,1,1,24);
d3d_transform_set_identity();
This don't work, the lines (cylinders) are not pointed to the target.
Does anyone here has a function to make this works ? Thanks