Auto center model

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Kjell,

This is beginning to get confusing :)

Correct me if I'm wrong here: When importing mix.3ds the scene is correct, that is all vertices in all three objects are at their right locations. No consideration is taken for each mesh pivot but since the whole scene is imported to a model centered on world coordinates 0,0 it does not look wrong?

I'm pretty sure that when experimenting with 3ds-files earlier I encountered files where the individual meshes where positioned incorrectly in regard to the other meshes. This is the kind of bugs I want to focus on. Perhaps this is when both mesh_matrix and pivot are set. Can you make such a 3ds-file so that when importing the file the meshes are no longer aligned?

Also I'm going to investigate import of UV-coords. If you want to help me with that you could give me a simple model with a simple texture that I can experiment with.

Regards,

Ville
User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

I've done a close inspection on various .3ds exports and it's not all that complicated actually.

The first question is wether or not to take the Pivot vector ( B013 ) in concideration or not. This is the value that is causing the 0.5 offset abnormalities ( the default pivot Y value when creating a cube ). I personally think it's probably best to just discard the value, since it cripples the ability to tweak your 3d scenes swiftly. But in case you want to keep things the way they are, a note in the manual that objects need their XForm to be reset would be useful.

The other is that when you import a object into ZGE that has it's CoG and pivot / position at for example 10,0,0, it's model gets positioned at 0,0,0, while the mesh vertices are located around 10,0,0. Hence my suggestion to generate a seperate model component per imported object.

*I'll set you up with a "X-Form reset" .3ds containing proper UV data and a accompanying texture. 8)

Hope this clears things up,
Kjell
Post Reply