2d to 3d, placing text above model, mousecursor

Blitz3D Forums/Blitz3D Programming/2d to 3d, placing text above model, mousecursor

Jeroen(Posted 2003) [#1]
Hi,

(placed this post in wrong forum, so I moved it here

============================================================

I'd like to place text above someone's head (entity) in 3D space. Only, the text command is made for 2D coordinates.
How can I do this anyhow?

Secondly, how can I use MouseX() and Mouse(Y) to show a mouse pointer (a sprite in 3D world)? Same issue here: I need to translate it to 3D space somehow.

Thank you very much!

Jeroen


GitTech(Posted 2003) [#2]
Have a look at the CameraProject command:

CameraProject camHandle,x3d#,y3d#,z3d#
x2d=ProjectedX()
y2d=ProjectedY()


EDIT: Btw, that's a reply to your first question :)


Rottbott(Posted 2003) [#3]
You shouldn't use the Text command in a 3D game at all, except for debugging purposes.

For your first question, I suggest that you use a quad mesh or a sprite above the head entity (make it a child of the head). Then just texture it with a masked texture (flag 4) with the text you want on a black background.

Second question is a bit more tricky. I suggest you have an invisible "picking" quad which is parented to the camera. It should be at, say, (0, 0, 200) and facing towards the camera. It should be scaled to fill the whole screen. Use HideEntity to make it invisible. Set its pickmode to polygon.

Now each loop to position your mouse, first ShowEntity the picking quad. Now do a CameraPick() at the mouse co-ordinates. Use PickedX#(), PickedY#(), PickedZ#() to position your mouse quad/sprite and point it towards the camera. Then HideEntity the picking quad again.


Jeroen(Posted 2003) [#4]
Hi everyone, thanks for the help until now, I'll check out Fontext!