3D hudmessage script

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

3D hudmessage script

Post by ZZYZX »

HI

The script separately: http://pastebin.com/9hqEzjR2
Example map: http://www.mediafire.com/download/u48iq ... 3/MEOW.wad

Use it by calling DrawText3D with the following arguments:
string — the text string to be drawn.
id — identifier of the hudmessage.
color — CR_ constant.
x, y, z — coordinates (in world space) of the hudmessage.
px, py, pz — coordinates of the camera.
fang — angle of the camera.
YAng — pitch of the camera.

People are free to use the script in whatever ways possible, I don't care.

Notes:
  • This is actually 3D, and as such only works for OpenGL renderer, for software version see HudMessageOnActor in the wiki.
  • Movebob/stillbob aren't implemented. An example on how to implement movebob is here (function CalculateBob, note that it's unfinished too).
  • FOV isn't implemented, only 90.
Also non-lazy people are welcome to fix the bobbing and make unified version for software compatibility :P
Also "I don't know how it works" isn't a joke, the code is basically a piece of ancient DOS software rasterizer and a weird compensatory crutch for 1.2 vertical scale on top of it, that somehow works.
People who actually understand how it works are welcome too.
User avatar
kodi
 
 
Posts: 1361
Joined: Mon May 06, 2013 8:02 am

Re: 3D hudmessage script

Post by kodi »

Thanks for posting this. I've been trying to do this in the past but couldn't figure out the fornula for projection after rotation, and every example of code like this I've come across in zdoom is tied to larger systems.
Locked

Return to “Editing (Archive)”