AggrorJorn Posted March 7, 2010 Share Posted March 7, 2010 I suppose there isn't really a not-to-complicated way for drawing text on to objects, instead of drawing them on top of the screen? Quote Link to comment Share on other sites More sharing options...
Flexman Posted March 7, 2010 Share Posted March 7, 2010 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) ; Quote 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 More sharing options...
Rick Posted March 7, 2010 Share Posted March 7, 2010 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. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 7, 2010 Author Share Posted March 7, 2010 @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. Quote Link to comment Share on other sites More sharing options...
Canardia Posted March 7, 2010 Share Posted March 7, 2010 How is it too much? It's just a simple command: AddNameTag(entity,"somename"); Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 8, 2010 Author Share Posted March 8, 2010 How is it too much? It's just a simple command: AddNameTag(entity,"somename"); Yeah but I am using Lua. or am I totaly blank here? Quote Link to comment Share on other sites More sharing options...
Rick Posted March 8, 2010 Share Posted March 8, 2010 You would have to take his code inside and convert it to lua. He's not doing anything that you can't do in lua, but you would have to do the work. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 8, 2010 Author Share Posted March 8, 2010 okay, I'l try some converting tomorrow. Quote Link to comment Share on other sites More sharing options...
Canardia Posted March 8, 2010 Share Posted March 8, 2010 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. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Rick Posted March 8, 2010 Share Posted March 8, 2010 Since this is in the Lua forums I assume he wants to use it in Lua. Just my assumption based on some observation Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 9, 2010 Author Share Posted March 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 11, 2010 Author Share Posted March 11, 2010 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) ; Quote Link to comment Share on other sites More sharing options...
Rick Posted March 11, 2010 Share Posted March 11, 2010 Maybe I'm missing something but you are passing a Vec3 into GetPosition(). GetPosition() doesn't expect a Vec3 does it? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 11, 2010 Author Share Posted March 11, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.