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 / [Help me (again)] position detection

Author
Message
Serengeor
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location: Lithuania/lietuva
Posted: 19th Jan 2009 19:55
Okay so here's what i need to know:
I see a place in my terrain where i would like to put my model or object in. i need to know its coordinates X,Y,Z.

GDK Developer since now
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 20th Jan 2009 14:39
If you make the terrain in another program, you should be able to see the coordinates in some way.
You can also make another program that load the terrain and the object, and then make so you can move the object in game in all directions and print out the coordinates.
Serengeor
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location: Lithuania/lietuva
Posted: 20th Jan 2009 15:36
well yea i tried to make thing that would print out camera x position but when i moved around the map it showed 0
Could someone post a code so it would solve my problem.
Well lets say i have object box box will detect X,Y,Z coordinates.
coordinates of box are going to be printed out at top of screen.

GDK Developer since now
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Jan 2009 00:10
Something like this should help:



dbText would probably be better but I have never used it for variables.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 22nd Jan 2009 10:48
Yeah, you should use dbText() since dbPrint() mess up the screen if you used that with a 3D space. And you should wrap dbStr() around camX, camY and camZ.
Serengeor
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location: Lithuania/lietuva
Posted: 25th Jan 2009 18:29 Edited at: 25th Jan 2009 18:44
Lulz.
I should have searched more in documentation .
Ty for helping but the dbPrint can't have position set up right ?
How do i warp it with dbStr ?

GDK Developer since now
atomic knights
16
Years of Service
User Offline
Joined: 12th Apr 2008
Location: On my laptop
Posted: 25th Jan 2009 19:16
here is a simple little piece of code. As stated, load your terrain, dbControlCameraUsingArrows and call the dbg_hud function inside your LoopGDK with 0 as the parameter. If you make a object, you can pass that obj number and it will tell you where the object is. You can use this to help you position objects on your terrain.

hope this helps

ricky

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Jan 2009 19:47
Quote: "Ty for helping but the dbPrint can't have position set up right ?"


Are you using default camera?
Serengeor
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location: Lithuania/lietuva
Posted: 26th Jan 2009 08:08 Edited at: 26th Jan 2009 08:09
Lulz i think you misunderstood me.
what i say is that when i use dbPrint you cant set position (XY) on screen like dbText.
here's something from documentation :
dbPrint:

dbText:


GDK Developer since now
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 28th Jan 2009 01:59
dbSetCursor() or whatever.
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 28th Jan 2009 06:26
Place it in the main loop.



you can do same with Y and Z variables. Have fun :p

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
Serengeor
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location: Lithuania/lietuva
Posted: 28th Jan 2009 08:55
yeah i know i can set up positions for dbText (I already done that ) thnx for the help.
@Zuka
why the hell did you wrote "dbSetCursor() or whatever." ?

GDK Developer since now
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 28th Jan 2009 11:02
If you use dbPrint(), you should use dbSetCursor() to position the printing point.
Serengeor
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location: Lithuania/lietuva
Posted: 28th Jan 2009 14:02
oh thats good than

GDK Developer since now

Login to post a reply

Server time is: 2024-11-25 13:35:08
Your offset time is: 2024-11-25 13:35:08