I like this little set of code quite a bit!
This reminds me somewhat of how I basically do
italics without loading a different font for use with it. One of my most used tools is my "TextToImage" routines, and once I have an image, it's a breeze to put a tilt of various amounts on it, like so:
text$ = "Hello World!!"
' x1 x2 (slide the top left or right to create an italicized look for the font)
'y1 -----------
' | /|
' | / |
' | / |
' | / |
' |/ |
'y2 ----------- (we could also slide the bottom in an opposite direction as well, but I don't here)
sx1 = 0: sy1 = 0
dx1 = 200: dy1 = 100
dx2 = 200 + sx2 * 3: dy2 = 100 + sy2 * 3
direction = 1
tilt
= tilt
+ direction:
IF ABS(tilt
) > 300 THEN direction
= -direction
_MAPTRIANGLE (sx1
, sy1
)-(sx2
, sy1
)-(sx1
, sy2
), source
TO(dx1
+ tilt
, dy1
)-(dx2
+ tilt
, dy1
)-(dx1
, dy2
) _MAPTRIANGLE (sx1
, sy2
)-(sx2
, sy1
)-(sx2
, sy2
), source
TO(dx1
, dy2
)-(dx2
+ tilt
, dy1
)-(dx2
, dy2
)
I haven't sorted out the math in your code yet, but it seems to work on a similar principle to the above (just taken to a greater degree).
My question is this one: Can you take what you've got and make us a SUB which would allow us to make a custom 3D-style font? Something like the following:
SUB 3dText (x, y, text$, thick, tilt)
x/y would be where we'd want to place the text at on the screen.
text$ would be the text we'd want to place.
thick would be the thickness of the text (your demo has a rather thick looking 3D text; I'd prefer one half as deep usually, so a variable to adjust for that thickness would be nice.)
tilt would would decide the direction that the 3d text would tilt in. "Hello World" with the shadow/thickness to the left, or the right, or wherever we wanted...
It's a little beyond my 3D skills, without a lot of brushing up and studying, but such a little routine would be PERFECT for the toolbox here on the forums. I know I for one would love to be able to make use of such a versatile little snippet! ;)