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 / AppGameKit's Z Axis is reversed?? o.O

Author
Message
LillyByte
7
Years of Service
User Offline
Joined: 30th Oct 2017
Location:
Posted: 22nd Feb 2018 04:26 Edited at: 22nd Feb 2018 04:36
To show my point, I created a default axis object... I checked this object in different programs: Silo 2, Nvil, 3D Coat, and MODO. In all these programs, the blue arrow (Z+) of the object is pointing in the Z+/forward (also, it's pivot is aligned to the object, so it is pointing in the right orientation). If someone can show me something wrong with my axis object, please do.

However, if I load this object into AppGameKit and apply location translations or use a SetObjectLookAt... the Z axis is completely reversed... among other commands. Axis movement for X and Y work as expected.

I have include the axis object and a short AppGameKit program to demonstrate the Z axis issue.

I have been working around it, but... it's getting to a point where it's getting to be more of a burden to work around than to just use something else. This is no small bug, it's a critical flaw for any kind of 3D game building. To point, I'd love to see this fixed, because I do love AGK. I hope this can be fixed soon, I don't want to have to use another engine.
~~ LillyByte ~~
http://www.dymoria.com

Attachments

Login to view attachments
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 22nd Feb 2018 05:01 Edited at: 22nd Feb 2018 05:07
I have not encountered the issue. And actually when I load your object into two 3D modeling programs it actually is backwards so in your test project it moves as expected... forward is backward visually.
I also rotated it around so it really is facing forward and saved it again loaded into your test program and it now moves forward as forward appears on the model and backwards as backwards appears on the model.

I know that some modeling programs do reverse the z axis. I remember reading about it on the Unity forums and I think they even had an option during import to reverse the z-axis to get around the issue IIRC.

I think it is something to do with there are two distinct systems that can be used by game engines and modeling programs: left-handed Y-up and right-handed Z-up. A lot of the folks using Unity use 3DMax and that uses the right-handed Z is up system so when imported into Unity the model orientation is wrong. And I am only mentioning Unity because I remember this kind of problem being experienced by people over there and that was the gist of it as I recall.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
LillyByte
7
Years of Service
User Offline
Joined: 30th Oct 2017
Location:
Posted: 22nd Feb 2018 05:12 Edited at: 22nd Feb 2018 05:12
What modeling programs are you loading it into?

I ask, because in the commercial heavyweights like 3D Coat and MODO... the axis is correct for me. I yet to encountered the Z axis being reversed anywhere else in anything commercial. I also just loaded it in Substance Painter, Z axis is correct there. So, Nvil, MODO, 3D Coat, Substance Painter, etc... my axis is correct.

So, if AppGameKit is using some non-standard axis then it's definitely a no-go for me. Spending time to reverse axis of models to be non-standard... that's... just no.
~~ LillyByte ~~
http://www.dymoria.com
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 22nd Feb 2018 05:45 Edited at: 22nd Feb 2018 06:18
I don't think it is really a case of the z being correct or incorrect. There are just 2 different orientation methods that are common. Game engines seem to often use the opposite of what is common in the 3d modeling programs. Like I said this is something people run into with models created in 3DMax when used in Unity. It is not that either is wrong they just happen to use different orientations. Both are valid.

Anyway... I use only free modeling software. Anim8or and Blender. And I use Anim8or much more than Blender. Have used it for about 17 years now because it is just simple and easy to work with. I am a programmer not an artist so my needs are basic. Lol

There should be a way to change the orientation when saving or maybe TGC can create a flag during model load to handle that. But one or the other side needs to handle it. Maybe put in a request for it and see if they can add in next update. A flag would be great otherwise if they just change for your programs then it will simply cause the same problem for me and others.

Well that is just my guess on what is going on. Not on expert on it by any means I just remember other folks having this kind of issue in one of the big game engines.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
LillyByte
7
Years of Service
User Offline
Joined: 30th Oct 2017
Location:
Posted: 22nd Feb 2018 06:48
Generally, between programs... axis can have different alignments. You might have a Y up or a Z up (for instance, Z is up in Unreal and Y is up in Unity (which is more commonly accepted).... but, the axis positive/negative of the Z, I've never seen that changed. Most programs have options for flipping Y up or Z up (Maya, MAX, MODO, etc, all have this option), it's an option. But, I haven't seen any modeling programs have an option to flip the actual orientation of an axis from positive to negative.

Having a negative Z axis... is just plain weird.

I'll likely work around it because well, I like AGK. But non-standard things are so annoying.

~~ LillyByte ~~
http://www.dymoria.com
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 22nd Feb 2018 07:56
It is the difference between a left handed coordinate system and a right hand coordinate system. DirectX uses left handed and OpenGL uses right handed. If your model is saved in one orientation, but rendered in another, then the z axis will be flipped the wrong way.
https://msdn.microsoft.com/en-us/library/windows/desktop/bb324490(v=vs.85).aspx
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 22nd Feb 2018 10:45 Edited at: 22nd Feb 2018 11:00
That's it @Tom. I think I lumped two different issues that can happen together in one. I was thinking one of the two had z-up which caused it. But this is different... the left right systems causes z to be flipped in a game engine using a different system.

Thanks for clarifying.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
LillyByte
7
Years of Service
User Offline
Joined: 30th Oct 2017
Location:
Posted: 22nd Feb 2018 11:25
Quote: "It is the difference between a left handed coordinate system and a right hand coordinate system. DirectX uses left handed and OpenGL uses right handed. If your model is saved in one orientation, but rendered in another, then the z axis will be flipped the wrong way."


Most commercial software programs use the right handed coordinate system, the same as OpenGL platforms. If AppGameKit uses OpenGL then my axis should be correct in AGK... or, AppGameKit has a flipped coordinate system-- which is kinda what I'm saying.
~~ LillyByte ~~
http://www.dymoria.com
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 22nd Feb 2018 11:57 Edited at: 22nd Feb 2018 12:01
FixObjectPivot may be an easy way to solve the issue. Not sure because I have never used it but sounds very useful. Didn't know we could manually set the pivot like that. Great stuff.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 22nd Feb 2018 12:18
My guess is that your using FBX ? , if so just export as .x and it should be correct , i believe there is a invert z in the fbx format that are not currently supported in AppGameKit import ( i seen the same but only in fbx ) , so try .x
Subscribe and checkout great AppGameKit video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-11-24 00:27:07
Your offset time is: 2024-11-24 00:27:07