Hello there!
I'd like to request help on swapping the Y axis with the Z axis (Z as height).
I can't stand using Y as height, since I've been using Z for most of my coding now, it really bothers me to set something to the Y axis and then find it going up or down instead of sideways and then have to recompile with the vectors swapped.
Do I need to modify the engine itself or is there another way?
Thanks for the assistance.
Need help swapping the Y axis with the Z axis.
-
- Posts: 3
- Joined: Fri Nov 16, 2018 4:24 am
Need help swapping the Y axis with the Z axis.
oh god do I despise the y axis
Re: Need help swapping the Y axis with the Z axis.
if you want to use right handed coordinate system its easy.
You just need to patch all of the cameras+CMatrix class to swap Y with Z.
Also make sure to change backface culling to front-face or change the order of triangle indices in all meshes.
You just need to patch all of the cameras+CMatrix class to swap Y with Z.
Also make sure to change backface culling to front-face or change the order of triangle indices in all meshes.
Re: Need help swapping the Y axis with the Z axis.
You can set the up-vector of your camera to 0,0,1. Be aware as long as you don't change to right handed coordinate system (which I wouldn't recommend really...) it means y is coming towards you now (or x to the left).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 3
- Joined: Fri Nov 16, 2018 4:24 am
Re: Need help swapping the Y axis with the Z axis.
I'm currently using the FPS camera, and this produces a really weird movement when moving the mouse: the world flips midway when moving the mouse up or down, and moving it left or right makes a spiral-like motion (right spirals down, left spirals up).CuteAlien wrote:You can set the up-vector of your camera to 0,0,1. Be aware as long as you don't change to right handed coordinate system (which I wouldn't recommend really...) it means y is coming towards you now (or x to the left).
The only code involving the camera is this:
Code: Select all
SKeyMap keyMap[4];
keyMap[0].Action=EKA_MOVE_FORWARD; keyMap[0].KeyCode=KEY_KEY_W;
keyMap[1].Action=EKA_MOVE_BACKWARD; keyMap[1].KeyCode=KEY_KEY_S;
keyMap[2].Action=EKA_STRAFE_LEFT; keyMap[2].KeyCode=KEY_KEY_A;
keyMap[3].Action=EKA_STRAFE_RIGHT; keyMap[3].KeyCode=KEY_KEY_D;
ICameraSceneNode* camnode = smgr->addCameraSceneNodeFPS(0, 50, 0.7, -1, keyMap, 4, false, 3);
camnode->setUpVector(core::vector3df(0, 0, 1));
oh god do I despise the y axis
Re: Need help swapping the Y axis with the Z axis.
I got an idea why, but will have to check. But yeah, could be some stuff does not work then as expected - Irrlicht really is coded to have Y up.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Need help swapping the Y axis with the Z axis.
Sorry, it won't work with FPS-Camera. You will have to write your own for that. Going against the defaults of a library is always hard...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 3
- Joined: Fri Nov 16, 2018 4:24 am
Re: Need help swapping the Y axis with the Z axis.
Ok, thanks for the help!CuteAlien wrote:Sorry, it won't work with FPS-Camera. You will have to write your own for that. Going against the defaults of a library is always hard...
oh god do I despise the y axis