Sign in to follow this  
iamchenxin

Convert Skinned mesh from opengl to directx,flip X or flip Z,which is better?

Recommended Posts

iamchenxin    109

When i google "Convert Vertex from opengl to directx" ,most said " flip Z" .(Y up,right-handed to left-handed)

 

But considered: most 3d software, use  Z-axis  Positive T-pose to do skinned mesh.

 

Should "flip X" be better ?

 

since flip-Z always need to rotate from -z to +z .

 

when flip X,just get the exactly vertex.z.

 

But Why most post said " flip Z"?

Are there some disadvantage in "flip X " ?

Edited by iamchenxin

Share this post


Link to post
Share on other sites
frob    44973

Verify that your tutorial is current.

 

Systems have changed over the years. What you described was normal up until 2000.

 

If you live in the 1990's and you are using a fixed function pipeline then yes, the axis has changed and you need to do appropriate math to compensate. Flipping the Z axis was the biggest difference back in the DirectX 8 era and before.  You would also need to verify a small number of other things like triangle winding order, but otherwise it was easy.

 

But if you live in the current era of programmable pipelines you can write your program to specify whatever you want for the axis values. You just need to ensure your tools are operating consistently with themselves. Whatever axis that means flipping, whatever normals need flipping, whatever SH-encoded shaders you've got, whatever other changes you make, that is all entirely up to you and your unique content system.  These days there are potentially a large number of things that need flipping and changing when you change axis; the vertex position is only one of a long list of values that may need modification.

Edited by frob
Sorry, being a bit more polite.

Share this post


Link to post
Share on other sites
iamchenxin    109

Verify that your tutorial is current.

 

Systems have changed over the years. What you described was normal up until 2000.

 

If you live in the 1990's and you are using a fixed function pipeline then yes, the axis has changed and you need to do appropriate math to compensate. Flipping the Z axis was the biggest difference back in the DirectX 8 era and before.  You would also need to verify a small number of other things like triangle winding order, but otherwise it was easy.

 

But if you live in the current era of programmable pipelines you can write your program to specify whatever you want for the axis values. You just need to ensure your tools are operating consistently with themselves. Whatever axis that means flipping, whatever normals need flipping, whatever SH-encoded shaders you've got, whatever other changes you make, that is all entirely up to you and your unique content system.  These days there are potentially a large number of things that need flipping and changing when you change axis; the vertex position is only one of a long list of values that may need modification.

 

so that means there is no advantage with flip-z against other axis ?

Flip is doing a mirror,which axis be fliped is independent to other processes like winding, UV swap .

I should flip freely depend on my demand .

Share this post


Link to post
Share on other sites
frob    44973

so that means there is no advantage with flip-z against other axis ?
Flip is doing a mirror,which axis be fliped is independent to other processes like winding, UV swap .
I should flip freely depend on my demand .

 

There may or may not be an advantage to you. There may or may not be an advantage to others.

 

It is not mandatory, and has not been mandatory for almost 15 years since 3D hardware allowed programmable functionality rather than only the stock built-in functions.

 

You might decide to do it for convenience, or for consistency, or because you have already written code around those expectations, but the key thing is that it is no longer required. It is entirely optional.

 

Does it makes sense for you to flip everything? Should you choose to flip one axis over another? Or does it make more sense to add flags to your code to support different values since you are adding resources from different sources? Or does it make sense to have a different solution, such as having an artist flip any non-standard model in their art program rather than with a custom tool? 

 

The reasoning behind the choice and your own personal answer is unique to you, it's not something anyone here can answer.

Edited by frob

Share this post


Link to post
Share on other sites
iamchenxin    109

 

so that means there is no advantage with flip-z against other axis ?
Flip is doing a mirror,which axis be fliped is independent to other processes like winding, UV swap .
I should flip freely depend on my demand .

 

There may or may not be an advantage to you. There may or may not be an advantage to others.

 

It is not mandatory, and has not been mandatory for almost 15 years since 3D hardware allowed programmable functionality rather than only the stock built-in functions.

 

You might decide to do it for convenience, or for consistency, or because you have already written code around those expectations, but the key thing is that it is no longer required. It is entirely optional.

 

Does it makes sense for you to flip everything? Should you choose to flip one axis over another? Or does it make more sense to add flags to your code to support different values since you are adding resources from different sources? Or does it make sense to have a different solution, such as having an artist flip any non-standard model in their art program rather than with a custom tool? 

 

The reasoning behind the choice and your own personal answer is unique to you, it's not something anyone here can answer.

 

 

Get it , thx smile.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this