Jump to content
  • Advertisement
Sign in to follow this  
Dark Metamorphosis

repeated vertices in x file? good or bad

This topic is 4841 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

hi every one, recently I have noticed a problem, first of all I am using 3ds max 6, and I use the panda exporter to export my models into xfiles. so the problem is that if I export a cube of 8 vertices and 12 polygons, I find it in the xfile as a cube of 24 vertices and 12 polygons, so it is as if the xfile doesn't remove duplicated vertices and ingnores the use of indices. so is this a normal behavior of xfiles, or is it that the panda exporter has this error built in. or maybe should I do something in 3ds max 6 before exporting, please tell me about this..thank you

Share this post


Link to post
Share on other sites
Advertisement
No this is necessary because of the difference between a 3D Studio Max and a DirectX mesh representation. The core issue is this: DirectX allows only one normal per vertex and a limited number of texture coordinates per vertex. 3D Studio Max on the other hand has no such limitations.

Suppose you have a cube of which three sides are mapped with texture A and three sides with texture B. Some corner points will have to have the texture coordinates for A for supporting the faces on the one side while having to have the texture coordinates for B for supporting two other sides.

The solution (as implemented by Panda) is to split the vertex and repeat its position, but with different texture coordinates. Hope it makes sense to you!

Greetz,

Illco

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Illco got it. Just try to export the X file without selection "Mapping coordinates" (the file will contain 8 vertices).

Share this post


Link to post
Share on other sites
all right, it makes perfect sense now...
but still, panda exports multiple vertices even when I am not using any textures. so this means that I will have to implement a routine that will get rid of those duplicated vertices...of course if there are vertices with the same coords but different texture coords then they will not be considered as duplicates therefore they will be preserved...what do you think?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It is strange... if you selected the "Optimize" option, Panda shoud export 8 vertices for a box without mapping coordinates.
Also, no texture doesn't imply in no mapping coordinate. Try to export a new single box...
Well, I use Panda with 3ds max 4. I don't know if some Panda's settings changed after this version...

Share this post


Link to post
Share on other sites
As said the settings also hold for normals. For a cube, each corner has three normals in 3D Studio Max (one for each side it shares in). In DirectX only one normal is allowed so the vertex still has to be split.

The problem with the normals is less inefficient though (the cube is a bad case example though) because you can fix a little. Because 3DSMax works with smoothing groups (groups of normals that can be interpolated) you can average the normals for as much as they share the same smoothing group. But I'm confident Panda does this.

Greetz,

Illco

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!