HP Forums
Drawing 3D lines with LINE - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Drawing 3D lines with LINE (/thread-12829.html)



Drawing 3D lines with LINE - Eddie W. Shore - 04-18-2019 07:54 PM

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


RE: Drawing 3D lines with LINE - ijabbott - 04-18-2019 09:13 PM

Hi Eddie,

Didn't you write about rotation matrices back in 2015?


RE: Drawing 3D lines with LINE - Eddie W. Shore - 04-19-2019 01:37 AM

Yes Ian. However, I'm still not sure about P1 and P2 of the line definition matrix.


RE: Drawing 3D lines with LINE - Tim Wessman - 04-19-2019 01:50 AM

Take a look at the built in example program. Believe it rotates a tetrahedron from memory...


RE: Drawing 3D lines with LINE - Han - 04-19-2019 04:19 AM

(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).


RE: Drawing 3D lines with LINE - Eddie W. Shore - 04-19-2019 05:40 AM

Thank you, Han, much appreciated.