flip one axis at rendering ?

Problems building or running the engine, queries about how to use features etc.
Post Reply
ciberfred
Gnoblar
Posts: 7
Joined: Fri Feb 19, 2021 4:09 pm
x 2

flip one axis at rendering ?

Post by ciberfred »

Hello all, think that this question is all know but in my project i facing to a strange problem. I think i need to change the render of only one axis in the scene view.
Well let's explain i'm taking data from a file and render in the 3D environnement all is showing good but.... the X axis goes in the wrong way (for my rendering let's take an example:
Image
in fact in this image i need that the right goes to the left and left to the right.
if i try to set the camera projection matrix with scale(-1,1,1) (to reverse the X axis way) the camera in fact seems goes under the plane and all is upsidedown like this :
Image

i think it's because the model construction comming from windows D3D environnement. i searching how to do it in ogre but can't find a answer. imagine to play a pinball with the plunger on the left instead on the right....noway !

so i'm searching how to do it without managing all vertex re-creation of multiple objects on the scene (it's already pretty hard to build it as i'm new in ogre programming).
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: flip one axis at rendering ?

Post by paroj »

using a negative scale reverses the vertex winding and all your triangles are culled away.
Ogre has some code in place to detect this for entities, but for everything camera related, you have to adapt the culling yourself.
ciberfred
Gnoblar
Posts: 7
Joined: Fri Feb 19, 2021 4:09 pm
x 2

Re: flip one axis at rendering ?

Post by ciberfred »

So what is the way to do it ? build the index of vertices in reverse order ? or doing the scale on each entities objects ?
Pellaeon
Goblin
Posts: 230
Joined: Thu Apr 28, 2011 12:23 pm
x 28

Re: flip one axis at rendering ?

Post by Pellaeon »

Depending on your used software, it could be easier to mirror the model during export.
I know this issue when using the .X file format. E.g. when using Assimp, the library does the mirroring for you during import when loading X files.
ciberfred
Gnoblar
Posts: 7
Joined: Fri Feb 19, 2021 4:09 pm
x 2

Re: flip one axis at rendering ?

Post by ciberfred »

Well i manage with mesh read/loading by set x coordinate to -x and build triangles from 3,2,1 instead of 1,2,3 order.
Post Reply