Post Reply 
can you add text to a 3D drawing in a program
02-12-2023, 11:57 AM
Post: #1
can you add text to a 3D drawing in a program
I've done a 3D drawing using LINE and I want to label the vertices etc with text.

From the manual it appears TEXTOUT doesn't have an advanced option to do this (ie take a 3D position like LINE).

Is there anyway to do this?

TIA, dmh

Calculator Clique on YouTube
Visit this user's website Find all posts by this user
Quote this message in a reply
02-13-2023, 12:37 AM (This post was last modified: 02-13-2023 12:41 AM by Dougggg.)
Post: #2
RE: can you add text to a 3D drawing in a program
if you know the angle of the line you could use this to rotate the text


ATEXT (SS,XX,YY,ZZ)
BEGIN
DIMGROB_P(G1,83,12,RGB(255,255,255));
TEXTOUT_P(SS,G1,10,1,1,RGB(0,0,0));
ROTATE(G1,-ZZ);
BLIT_P(G0,{XX,YY},G1);
ROTATE(G1,ZZ);
END;

it puts the text in G1 and rotates it to angle (ZZ) and uses blit to put it in the g0

what i used it for -ZZ worked but you can experiment, I just needed Veritcal text
Find all posts by this user
Quote this message in a reply
02-13-2023, 11:42 PM
Post: #3
RE: can you add text to a 3D drawing in a program
Thanks. I'm not exactly sure what this is doing but will give it a go :-)

(02-13-2023 12:37 AM)Dougggg Wrote:  if you know the angle of the line you could use this to rotate the text


ATEXT (SS,XX,YY,ZZ)
BEGIN
DIMGROB_P(G1,83,12,RGB(255,255,255));
TEXTOUT_P(SS,G1,10,1,1,RGB(0,0,0));
ROTATE(G1,-ZZ);
BLIT_P(G0,{XX,YY},G1);
ROTATE(G1,ZZ);
END;

it puts the text in G1 and rotates it to angle (ZZ) and uses blit to put it in the g0

what i used it for -ZZ worked but you can experiment, I just needed Veritcal text

Calculator Clique on YouTube
Visit this user's website Find all posts by this user
Quote this message in a reply
02-14-2023, 03:02 AM
Post: #4
RE: can you add text to a 3D drawing in a program
it rotates the text, so you would have to have the angle, maybe wont work for your application Smile
Find all posts by this user
Quote this message in a reply
02-17-2023, 12:21 PM
Post: #5
RE: can you add text to a 3D drawing in a program
(02-12-2023 11:57 AM)dmh Wrote:  I've done a 3D drawing using LINE and I want to label the vertices etc with text.

From the manual it appears TEXTOUT doesn't have an advanced option to do this (ie take a 3D position like LINE).

Is there anyway to do this?

TIA, dmh

You'll have to manually project the text position from 3D to 2D space by multiplying the position vector by the rotation matrix which you used as input into LINE and then dividing the X and Y components each by the Z component.
Find all posts by this user
Quote this message in a reply
02-19-2023, 01:17 PM
Post: #6
RE: can you add text to a 3D drawing in a program
That's what I thought (unfortunately).

I did a bit of that in a past life but will have another go :-)

Thanks!

(02-17-2023 12:21 PM)jfelten Wrote:  
(02-12-2023 11:57 AM)dmh Wrote:  I've done a 3D drawing using LINE and I want to label the vertices etc with text.

From the manual it appears TEXTOUT doesn't have an advanced option to do this (ie take a 3D position like LINE).

Is there anyway to do this?

TIA, dmh

You'll have to manually project the text position from 3D to 2D space by multiplying the position vector by the rotation matrix which you used as input into LINE and then dividing the X and Y components each by the Z component.

Calculator Clique on YouTube
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: