Jump to content

Recommended Posts

Posted

If you mean floating text, over an objects postion?

 

CameraUnproject(), in bmax and example might be...


Local tpos:TVec3 = CameraUnproject(mycamera, entity.position.Plus(Vec3(0, 6, 0))) ;  ' ADD AN OFFSET ABOVE
DrawText("I can see my house from here", tpos.x, tpos.y) ;

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Posted

You can look at Gamelib and see how name tags are done. They draw text onto a "texture" that can be applied to a model. It's not the most straight forward way though. I think your assumption of this being an easy task is correct.

Posted

@flexman: Although its not what I really need, it is something I can perhaps use. Thanks for mentioning it.

 

@rick: I took a look at it, but thats too much for me unfortunately. Thanks for the suggestion.

Posted

How is it too much? It's just a simple command: AddNameTag(entity,"somename"); :lol:

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

You don't have to do everything in Lua, and you don't have to do everything in C++ either.

Just use them where each language fits best.

My approach is to make the main program in C++, and all the model scripts in Lua, so that I don't have to code them in C++ and it's easier to code model relations in Lua.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

You don't have to do everything in Lua, and you don't have to do everything in C++ either.

Just use them where each language fits best.

My approach is to make the main program in C++, and all the model scripts in Lua, so that I don't have to code them in C++ and it's easier to code model relations in Lua.

I have to agree with you on that. I will go back to C++ and the gamelib eventually, but for now I'm sticking with lua because I get some actual results with it.

Posted

CameraUnproject(), in bmax and example might be...


Local tpos:TVec3 = CameraUnproject(mycamera, entity.position.Plus(Vec3(0, 6, 0))) ;  ' ADD AN OFFSET ABOVE
DrawText("I can see my house from here", tpos.x, tpos.y) ;

I'm trying the CameraUnprject now. lets say I want to get an entity position and then add some extra coordinates to this, how would that go? I used a part of your code for this, but the extra Vec3 value doesn't work.

cubepos = CameraUnproject(fw.main.camera,cube:GetPosition(Vec3(0,-1,0))) ;  
       DrawText("A cube!!!", cubepos.x, cubepos.y) ;

Posted

I was using the example from Flexman. I interpreted it wrong since I am already getting the position. I just needed to know how to add extra Vec3 values to it. But I think I can do that in a line afterwards I realise now.

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.   Paste as plain text instead

  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...