Ask a Question related to Macromedia Director 3D, Design and Development.
-
ldeej #1
Using cylinders for line drawing
I have been trying to use cylinders for line drawing, unfortunately I have not
been able to get the results I want.
I am sure the problem is something really stupid (either in the Math or holes
on my understanding of the coordinate system).
I want to draw a line given a list of points. Two points will define a line
segment which will be drawn as a cylinder.
What I am getting is lines that do not intersect at the position points (They
are close though).
What am I doing wrong?
Here is my code:
--position_list is a list of 3D vectors
if position_list.count > 1 then
plane_number = 0
first_position = position_list[1]
repeat with position_counter = 2 to position_list.count
second_position = position_list[position_counter]
plane_difference = second_position - first_position
plane_difference_o2 = plane_difference / 2
plane_length = length(plane_difference)
plane_scale = vector(5, plane_length , 1)
plane_rotate = vector(0,0,0)
-- positioning the cylinder between the two points
plane_translate = first_position + plane_difference_o2
dir = plane_difference
dir.normalize()
-- Build rotation around Y
-- Adding 90 to align the cylinder correctly
plane_rotate.z = RadiansToDegrees(atan(dir.y/dir.x)) + 90
plane_rotate.x = RadiansToDegrees(-atan(dir.z/dir.y))
plane_test1 = world_object.newModel("line"&plane_number,
world_object.modelResource("cylinder"))
plane_test1.transform.scale(plane_scale)
plane_test1.transform.rotate(plane_rotate.x,0,plan e_rotate.z)
plane_test1.transform.translate(plane_translate)
plane_number = plane_number + 1
first_position = second_position
end repeat
end if
ldeej Guest
-
drawing line with actionscript
Can someone tell me please how I can draw a line with actionscript that grows longer but not wider. For example from coordinate 0,0 to 200,400. -
3d line drawing
What would be the best way to draw a free 3d spline inside the 3d world using a keyboard input (or any other input that allows accurate 3d... -
How is this done?? Line drawing.
Hi, I have recently started dabbling with Flash and I came across this site: www.caststoneuk.co.uk I really like the effect of the lines being... -
drawing a vector line
can someone suggest the best way to draw a line between a point and the mouseloc (mouse moving). Using vectors in flash is perfect but I want to... -
drawing a straight line!!! IS THIS ACTUALLY POSSIBLE??
don't use the shift key, and drag the line out by hand, check that the top and bottom rect points are only 1 pixel apart and you will have a...



Reply With Quote

