Post Reply 
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
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
Visit this user's website Find all posts by this user
Quote this message in a reply
04-18-2019, 09:13 PM
Post: #2
RE: Drawing 3D lines with LINE
Hi Eddie,

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

— Ian Abbott
Find all posts by this user
Quote this message in a reply
04-19-2019, 01:37 AM
Post: #3
RE: Drawing 3D lines with LINE
Yes Ian. However, I'm still not sure about P1 and P2 of the line definition matrix.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-19-2019, 01:50 AM
Post: #4
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.
Find all posts by this user
Quote this message in a reply
04-19-2019, 04:19 AM
Post: #5
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
Find all posts by this user
Quote this message in a reply
04-19-2019, 05:40 AM
Post: #6
RE: Drawing 3D lines with LINE
Thank you, Han, much appreciated.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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