Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Positioning Text in 3D space

Author
Message
Westa
13
Years of Service
User Offline
Joined: 28th Oct 2011
Location:
Posted: 11th Sep 2017 02:29
Has anyone come up with solutions to position 2D text in 3D space.

For example - attaching text labels to a 3D object - so that the text tracks with the object - updating scores or locations etc.

I guess something along the lines of - SetTextPostion3D( TextId, X , Y , Z ) ?

Westa
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Sep 2017 09:59
Make normal text, get said text as an image, use said image to texture a plain object, position said plain object in 3d space.
Click here for VR Legend of Zelda stuff
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Sep 2017 11:31
Simple text grab here, you would need to save to image rather than sprite - https://forum.thegamecreators.com/thread/220495
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Sep 2017 17:28 Edited at: 11th Sep 2017 17:29
Here you go !

I made it for my Shader Pack

Attachments

Login to view attachments
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 5th Nov 2017 13:41
janbo, that looks great! Do you think you could tell a bit more about how to use it? (I tried, but wasn't quite sure where to run which function.)
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Nov 2017 14:09 Edited at: 5th Nov 2017 14:20
Sure !
You paste this part somewhere above your main loop
just creating the data type and array that holds all the data for the Title:


You call Title_Add("Test Title",ObjectID) to Add a Title to an object, so this will probably also be above your main loop.
This creates a Text and fills the TitleData item and inserts it into the global Array.
Then you call Title_Update() somewhere inside your main loop.
This function works out the 2D position of the linked object you assigned previous.
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 6th Nov 2017 08:22

Thanks for the howto! Doesn't work in VR due to lack of depth, but just about perfect for monitor-based games!

Login to post a reply

Server time is: 2024-11-24 08:47:14
Your offset time is: 2024-11-24 08:47:14