Jump to content
  • Advertisement
Sign in to follow this  
iamchenxin

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

This topic is 1245 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement

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

You could always make OpenGL and Direct3D behave the same by flipping your world view matrix.

Going through all of your assets just to flip the Z is insanity.

Share this post


Link to post
Share on other sites

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

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

 

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!