Jump to content
Developer Wiki and Function Reference Links ×

Text to 3D extrude... First step to 3D notation


Assembly

Recommended Posts

Quick Little Script Will

1) Convert Text into a group of Polylines

2) For each poly in group

2.1 hXtrude

2.2 Rotate letters to a view angle.

Part i'm stuck on:

I want a boolean button to get the view and align the text extrude to the current view. I though this would be simply GetView(...). But this is not working. Sketch it out the Object needs to be rotated to be perpendicular to the 3D view angle. The math has me stuck.

Anyone?.

PROCEDURE TextTo3d;

VAR

xAngleR,yAngelR,zAngleR,offsetX, offsetY, offsetZ: Real;

tInteger:Integer;

tString:STRING;

hTemp1: Handle;

hTemp2: Handle;

XRot,YRot,ZRot: REAL;

FUNCTION Create3Dobj(h: HANDLE; z, dZ: REAL): HANDLE;

BEGIN

IF h <> NIL THEN BEGIN

BeginXtrd(z, dZ);

MoveTo(0,0);

LineTo(1, 1);

EndXtrd;

Create3Dobj:=lnewobj;

DelObject(FIn3D(GetParent(CreateDuplicateObject(h, LNewObj))));

DelObject(h);

END;

END;

FUNCTION hXtrude(h: HANDLE;dZ:REAL):HANDLE;

BEGIN;

IF h <> NIL THEN

BEGIN

hXtrude:=Create3Dobj(h,0,dz);

END;

END;

FUNCTION ExtrudeIt(h:Handle):Boolean;

VAR

hTemp:Handle;

BEGIN

hTemp:=hXtrude(H,0);

{HELP ME HERE}

Set3DRot(hTemp,90-XRot,90-YRot,90-ZRot,0,0,0);

END;

BEGIN;

GetView(xAngleR,yAngelR,zAngleR,offsetX, offsetY, offsetZ);

xRot:=pXRot;

YRot:=pYRot;

ZRot:=pZRot;

if pAlignToView Then

Begin;

xRot:=xAngleR;

YRot:=yAngelR;

ZRot:=zAngleR;

End;

tString:=pText;

BeginText;

tString

EndText;hTemp1:=LNewObj;

tInteger:=TrueTypeToPoly(hTemp1,hTemp2);

ForEachObjectInList(ExtrudeIt,2,1,FInGroup(hTemp2));

DelObject(htemp1);

Message('X:',XRot,' y:',YRot,' Z:',ZRot);

END;

Run (TextTo3d);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...