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.

Newcomers DBPro Corner / What are some of the coordinates.

Author
Message
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 9th Apr 2004 12:58
I can't understand how to estimate what x,y and z values to use.
What values do the corners have and the centre. If someone could help I would really appreciate it thanks

*For every problem you come across you gain something from correcting it, I hope.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 9th Apr 2004 15:25 Edited at: 9th Apr 2004 15:27
I can`t read minds, what x,y,z are you talking about?, object dimensions?, world co-ordinates?, rotation angles?, scale?, if it`s any help I assume a scale of 1 world unit to one meter, so a box 1,1,1 is one meter square, and if you position it 5 units away then its 5 meters along from you, and I place the camera 1.8 units above the floor which seems to be about right for my eye height in the real world, so a 12meter lorry trailer is 12 units long in my code, everything else is based around that, if you are facing "cybernorth" (default direction) then x+ co-ords are to the right and x- are to the left, with 0 in front of you and y+ are above the floor and y- are below the floor, while z+ are ahead of you and z- are behind you, hope thats some help, next time try to make it clear just what you are talking about, and where some code is not working then post the example so we can see if you have made any typo`s or logical errors in the code, thanks.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 10th Apr 2004 01:30 Edited at: 10th Apr 2004 01:32
There are only two coordinate systems in DB. Mentor has mentioned world coordinates which are 3D values with 0,0,0 being the center of the universe. What you see in world coordinates in based on the location and orientation of the camera and has nothing to do with screen coordinates.

Screen coordinates are based on 0,0 which is the upper left corner of your screen and heads down and to the right. Positive X is to the right with the right side being SCREEN WIDTH()-1. Positive Y is to the bottom of the screen with the bottom being SCREEN HEIGHT()-1. Yes, screen Y and world Y do head in opposite directions.

There are ways to make screen coordinates and world coordinates talk to each other, but you're nowhere close to that kind of logic, yet. When you need to work on object picking, that's when you should search this forum for those answers.

In general, objects and cameras use world coordinates. Sprites and pasted images use screen coordinates.
--
TAZ

Login to post a reply

Server time is: 2024-09-22 04:38:59
Your offset time is: 2024-09-22 04:38:59