# HP Forums

Full Version: Drawing 3D lines with LINE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
LINE(points definition, line definition, rotation matrix)
LINE(pre-rotated points, line definition)

I am trying to draw a 3D line from (0,0,0) to (1,2,1). I think I have the points definition down but the snytax of line definition confused me.

The line definition has the format {p1, p2, color*, alpha*}. P1 and P2 are index points but how do I use this?

What is the pre-rotated matrix?

What is the quickest and easiest way to draw a 3D line between (0,0,0) and (1,2,1)?

Also, how does the rotation matrix work?

Thank you,. Eddie
Hi Eddie,

Didn't you write about rotation matrices back in 2015?
Yes Ian. However, I'm still not sure about P1 and P2 of the line definition matrix.
Take a look at the built in example program. Believe it rotates a tetrahedron from memory...
(04-19-2019 01:37 AM)Eddie W. Shore Wrote: [ -> ]Yes Ian. However, I'm still not sure about P1 and P2 of the line definition matrix.

The values p1 and p2 are the index values (within the points definition) corresponding to the two endpoints of the line you wish to draw. Each line is of the form { p1, p2, color, alpha } (last two parameters are optional, I think). I.e. if you call your points definition 'ptsdef' then the command draws a line starting from the point ptsdef(p1) and ending at the point ptsdef(p2).
Thank you, Han, much appreciated.
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :