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.

Dark GDK / Problem with getting the position of my object

Author
Message
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 7th Mar 2009 22:24
I've loaded a tank model and positioned it at the screen but i'm running into some problems when i'm trying to position a piece of text at the objects X and Y position. First of all, the text appears in the top left corner instead of on the object. If i move my object down, the text moves up. If i move my object up, the text moves down. If i move my object to the left/right, the text moves faster than the object. So something is a bit messed up but i'm unsure what.

Help would be very appreciated



I've attached the tank model.

Attachments

Login to view attachments
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 7th Mar 2009 23:10
The value dbObjectPositionX is the x position in 3d space. the parameter for the text function is in 2d screen space.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Mar 2009 12:59
try dbText after the move commands, will then know the new position.

Dark Physics makes any hot drink go cold.
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 8th Mar 2009 13:27
HowDo... he will know the real position.. but it dont solve his problem and yeah.. the most posible thing its that the camera its 180 grades wrong... so if you go up.. it makes -X intead of +X.. but i dont sure... you cant loose nothing if you try
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 8th Mar 2009 14:43
Yeah it was messed up with the 2d and 3d space thingy like jezza said, when i positioned an extra object and checked if the first object was at the same position it worked. However i've run into a new problem, how do i move my object to location specified by the mouse click? I tried positioning an object at the mouse click location (if that worked i could just hide that object and check if the first object was at the same location). But i assume it captures where the mouse is in 2d as well because the object is not positioned where i click with my mouse. What should i do to be able to move an object to a position specified by the mouse?

AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 8th Mar 2009 15:28 Edited at: 8th Mar 2009 15:29
for 2d you can use


as you said the mouse cordinations are in 2d... i dont know how to make it 3d :p

Login to post a reply

Server time is: 2024-09-30 19:24:18
Your offset time is: 2024-09-30 19:24:18