Jump to content


Photo

Text over Player in 3D?


  • Please log in to reply
7 replies to this topic

#1 ck2k

ck2k

    GMC Member

  • New Member
  • 68 posts

Posted 15 August 2010 - 04:05 PM

First of all, this is my first try with 3d stuff in GM :o
Secondly i'm just trying some things right now i'm not making a serious game in 3d..

Well..
I made up a 3rd Person "game" the player can walk around and so on.. (i don't use any models, only the build in functions of gm)
Now I want to display a Text over the head of the player.. Like the name or a text he's saysing..

The draw_text function only displays the text on the floor of my room.. i guess i need to do something with d3d_set_projection_ortho() or something.. but i don't know the values i need to fill in..

It should look like the names in 3d MMORPGS or something i hope you know what i mean..

any hints or solutions?

thanks :)
  • 0

#2 demon13

demon13

    GMC Member

  • New Member
  • 444 posts

Posted 15 August 2010 - 04:21 PM

I think you could do this by using the d3d_transform_* functions.
d3d_transform_set_identity();
d3d_transform_set_translation(0,0,0)//this will be the center
d3d_transfrom_add_rotation_x(90);//This makes it go along the y and z axis I believe
d3d_transform_add_rotation_z(direction from the player to the camera)//this will make it face the camera at all times.
//Draw stuff goes here
d3d_transform_set_identity();

I'm not sure if this is the correct order or whether you should use *set* or *add*, but mess around with this, it may at least help you.

Hopefully this will help spark an idea.
  • 0

#3 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3300 posts
  • Version:GM8.1

Posted 15 August 2010 - 08:09 PM

Phantom107 has a nice example with a 3d point converted to 2d and the text is drawn in an orthographic projection

http://gmc.yoyogames...howtopic=416555
  • 0

#4 ck2k

ck2k

    GMC Member

  • New Member
  • 68 posts

Posted 19 August 2010 - 04:12 PM

Thank you, it looks like it almost works now, but:

During the Game i create some instance which also have an 3D model, but I can't see them in 3D anymore.. now it shows me the 2D topview version without any colors (black only) can you tell me how to fix that?
  • 0

#5 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8297 posts
  • Version:GM7

Posted 19 August 2010 - 04:17 PM

Make sure the orthographic object has the lowest depth of any object.
  • 0

#6 ck2k

ck2k

    GMC Member

  • New Member
  • 68 posts

Posted 19 August 2010 - 04:33 PM

Make sure the orthographic object has the lowest depth of any object.

Thanks mate! :)
  • 0

#7 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8297 posts
  • Version:GM7

Posted 19 August 2010 - 04:49 PM

No problem.
  • 0

#8 grumpymonkey

grumpymonkey

    GMC Member

  • GMC Member
  • 1011 posts

Posted 21 August 2010 - 04:35 AM

If this is for another mmo attempt I don't want to help.

You basically just make a billboard ontop of the player and draw the text onto it
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users