Jump to content

Drawtext on model.


AggrorJorn
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ■

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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) ;

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...