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 / Mixed up dimensions in 3D?

Author
Message
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 27th Jan 2009 20:39 Edited at: 27th Jan 2009 20:43
Today I have discovered one very very silly looking thing.Y and Z dimenions in 3D were mixed up! I have tried to make a terrain with heightmap,by scaling it. When I reduced Z I thought that it will be lower,but I mistaken... It became shrinked but not in height but in lenght I think. When I have changed Y value it became lower! So stupid damn it!

So in DARKGDK it is:
X-Width
Y-Height (?????)
Z-Lenght (?????)

What the...? Is there any solution for switching Y with Z?

EDIT: soz for grammar. Not very good in English :3

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.
code master
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 27th Jan 2009 20:59
That's how it's done.

You could write custom functions to reverse them...

I would suggest getting used to it, as it's very common in Game Programming.

jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 27th Jan 2009 21:23
Why is that wrong. It is an extension of normal 2D cartesian co-ordinates:

y
^
|
|
|______>x

so for 3D one just adds depth:
y
^ z
| ^
| /
|/______>x
Dark Inferno Studios
18
Years of Service
User Offline
Joined: 7th Nov 2006
Location: United Kingdom
Posted: 27th Jan 2009 21:38
Hi Murloc,
In 2D cartesian it is:

y
^
|
|
|______>x

Just like jezza said, but in 3D cartesian, he's wrong, it's actually:

z
|
/ \
x y

Hope this helps.

-Mike
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 27th Jan 2009 23:08
Actually, the DirectX standard is Y-up.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 28th Jan 2009 04:56
Both are valid, however I find that Y being up actually make sense unless you're looking at a map so get used to it. Both OGL, D3D and classical mathematics use Y as up(You've never heard of along the corridor(X) and up the stairs(Y)?), it's only in engineering areas such as CAD software that I see Z as up, so if anything Z being up is stupid and wrong.

Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 28th Jan 2009 06:01 Edited at: 28th Jan 2009 06:12
Thanks guys. I have beed coding with software which had X for lenght Y for width and Z for height,so now it is not logic for me.. Still gonna get used to this..

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.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 28th Jan 2009 06:25
That's why I stick with 2D.

Seriously, my college geometry initially dealt with x and y only then added z later as a mutually perpendicular axis. Totally logical when restricted to two dimensions for demo purposes. Your video screen is similarly limited and since it plot x/y on the 2D surface it's probably easier to keep those where they are.

What I don't understand is why they went with a left-hand system. I'd expect positive Z to come toward the "viewer."

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 28th Jan 2009 10:01
Quote: "What I don't understand is why they went with a left-hand system. I'd expect positive Z to come toward the "viewer.""


What value would then be at the camera position? Something exceptionally high? Remember that using IEEE754 floats the accuracy of the values isn't linear as with integers, but you have higher decimal precision at lower exponents as you have a finite amount of significant figures the float will be accurate to. So if the camera is at 0,0,10000000 then the Z-depth accuracy at that range would be abysmal.

I think the system makes perfect sense, once vertices of a model are transformed anything at 0,0,0 is directly on the camera, anything down the Z axis will be farther from the camera, X to the sides and Y vertically.

entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 28th Jan 2009 10:48
Someone claimed that this mixup started in 3D tools like 3D Studio. They chose or simply happened to put the Z-depth on the wrong axis and the phenomenon has remained in the industry ever since.

Most tools suffer from the same issue, actually. It's become something of a systematic error that people believe to be true, even.
Hayer
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 1st Feb 2009 14:32
@ entomophobiac

I belive u failed. Links to trusted sites and I may consindering beliving u.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Feb 2009 01:57
My Word - Such Hostility... "Stupid" "Failed" LOL

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 2nd Feb 2009 02:02
Crazy bastards. Get along!
DGZ
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 2nd Feb 2009 03:39
I bet you were using GameMaker at first, weren't you? I use it too (not too much anymore though), and I got a bit mixed up for a few minutes while I tried to figure out why my Terrain was growing shorter, instead of higher.

What does the variable 'c' represent in the equation 'E = MC^2'? Get it right, and I'll give you a cyber cookie.

Login to post a reply

Server time is: 2024-11-25 13:47:47
Your offset time is: 2024-11-25 13:47:47