Drawing 3D lines with LINE
04-18-2019, 07:54 PM (This post was last modified: 04-18-2019 07:56 PM by Eddie W. Shore.)
Post: #1
 Eddie W. Shore Senior Member Posts: 1,584 Joined: Dec 2013
Drawing 3D lines with LINE
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
04-18-2019, 09:13 PM
Post: #2
 ijabbott Senior Member Posts: 1,295 Joined: Jul 2015
RE: Drawing 3D lines with LINE
Hi Eddie,

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

— Ian Abbott
04-19-2019, 01:37 AM
Post: #3
 Eddie W. Shore Senior Member Posts: 1,584 Joined: Dec 2013
RE: Drawing 3D lines with LINE
Yes Ian. However, I'm still not sure about P1 and P2 of the line definition matrix.
04-19-2019, 01:50 AM
Post: #4
 Tim Wessman Senior Member Posts: 2,293 Joined: Dec 2013
RE: Drawing 3D lines with LINE
Take a look at the built in example program. Believe it rotates a tetrahedron from memory...

TW

Although I work for HP, the views and opinions I post here are my own.
04-19-2019, 04:19 AM
Post: #5
 Han Senior Member Posts: 1,882 Joined: Dec 2013
RE: Drawing 3D lines with LINE
(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).

Graph 3D | QPI | SolveSys
04-19-2019, 05:40 AM
Post: #6
 Eddie W. Shore Senior Member Posts: 1,584 Joined: Dec 2013
RE: Drawing 3D lines with LINE
Thank you, Han, much appreciated.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)