Version 0.8 - Test scene objects not in original locations...

Jan 10, 2012 at 9:01 AM
Edited Jan 10, 2012 at 1:38 PM
Hi again,

I like the new version 0.8 code, so far it looks nice and neat and well thought out.

I am playing with loading my own scenes to see how XNAfilnal manages with them, but i am having a strange thing happening with the objects in my scene, I think that it also happened in V0.7.

I have modelled a scene in 3DSMax, with a few, separate objects in the scene, at various locations on a ground plane. Exported to FBX, I then used the LamborghiniMurcielagoScene, to load my FBX. So, it is 1 FBX file with multiple thingies in it.

It loads, not problem, but it seems to have 'centered' all the objects in my FBX, and not maintained their original positions. Why is this?

 

Original model, as seen in 3DS max:
http://www.flickr.com/photos/73985989@N05/6672428659/in/photostream/
Model, as seen in XNAFinal:
http://www.flickr.com/photos/73985989@N05/6672436425/in/photostream/

 

BTW: Great work thanks!

JDS.

Coordinator
Jan 10, 2012 at 3:22 PM
Edited Jan 10, 2012 at 3:22 PM

Hi John!

Good news, at least for me, the engine is not the problem.

I use Softimage XSI, but I think this is also valid for 3DS. Model exporters sucks, I had problems with every exporter that I use the last 5 years, and I used several.

I do this (in Softimage):

  • Freeze transformations. I.e. every object is in its place but it is positioned in 0,0,0. Another alternative is to move the object to 0, 0, 0 and translate it to its desire position using the engine commands. 
  • Merge object together. 
  • Use .x if fbx is not working.

I hope it helps!! Bye!! José.

 

Jan 10, 2012 at 5:12 PM

Hi José,

Thanks for the suggestions, I will try them for use in your engine. However, when I use the same FBX file in a bog-standard xna test app, I dont have this issue. All the objects are drawn in the correct location, though I am getting strange draw-order problems (object appearing in front when they should be behind others). Wierd stuff.

This test app is the basic ones you find on the internet, you know, examples of loading content and drawing it.

I will keep trying. I dont want to have to manually move my objects into the correct position. For instance, I might have a complex scene with buildings etc, static objects, I need their position to remain where it is when designing the scene.

Obrigado!

Joao.

Coordinator
Jan 10, 2012 at 5:21 PM

Interesting. I always face so many problems with exporters that I didn’t test my models with other engines/applications. Besides, I have learned so many tricks to export objects that it becomes natural to do it.

 

Maybe I will test this, but in the future (too many things to do right now)

 

Chau and gracias!!! ;)

Jan 10, 2012 at 5:27 PM

Hi boys..

I had problem with this too. Not in this engine, but elsewhere (in my "engine" :)). The reason is simple - when Jose freeze transformations, local transforms of meshes are equal  to Matrix.Identity.  But when Joao load his objects (complex) - their local transformations aren't Matrix.Identity - but I think this is a right solution -  freezing transformations in Softimage is not right way. You will have problems with animations, because you cannot rotate meshes along their local axis - Microsoft has an example, when tank rotates with his gun - it's exactly this situation. If you freeze transformation for the gun, the gun will be at the same location as tank's body. And transforming gun's position and rotation again in engine is not simple. It should be good to have solution for this in the engine..

Sorry for my English..

Bye Tom

P.S. thanks for your renderer - it's amazing!

Coordinator
Jan 10, 2012 at 5:35 PM

Hi pospik!!

When I need local transformations I place the object’s pivot to 0,0,0 Just like the lambo tires and the FA-22 flaps (I never upload it but I do it that way).

I have the advantage that I am my own artist, so I have no complains of him. :p

Thanks!! :)

Jan 10, 2012 at 9:08 PM

Yes, I did exactly the same think :) I'm too my own artist, but I'm using Maya :) But how do you rotate these flaps and tires? I found this problem when I tried to make a door in house. Now I'm in state, that I have my custom model.. When "my engine" (I'm using your renderer..) load object, it immediately extract all meshes and create custom meshes. These meshes has their own material etc. and these are my objects for rendering - I'm sending them to render manager. Axis in my door are not in center, but on hinge and this is reason, that I can easily open/close door.

I have some work flow for making 3d objects in Maya.. My meshes has such names and engine extracts and makes - for example - physic objects based on mesh name and its prefix (phys_box_door_0). I need local transformations for these objects too, because physx need them.. (I'm using physx .net wrapper). This custom mesh has then physics representation too.

Jan 11, 2012 at 12:40 PM

 

Hmm, thanks guys, many different options to explore. I have just one question for Jose:

I was going throught your GameLoop class, to see how you are actually drawing the model elements, just to compare with my test app, and I noticed something at the bottom of the RenderCamera method:

 

            return postProcessedSceneTexture;
            RenderTarget.Release(postProcessedSceneTexture);
            return gbufferTextures.RenderTargets[1];
            //return sceneTexture;
        } // RenderCamera

 

This may have nothing to do with my problem, but it is a clear issue here. Obviously the last 2 lines of code will never execute. Mistake maybe??

Cheers

Joao

Coordinator
Jan 11, 2012 at 1:23 PM
Edited Jan 11, 2012 at 1:24 PM

No, is just for testing, when I want to see the different stages of the deferred lighting I do the following:

// return postProcessedSceneTexture; // comment this

RenderTarget.Release(postProcessedSceneTexture); // Release the texture to avoid a crash

return gbufferTextures.RenderTargets[1]; // return desired texture. It was already released but I know that probably no one will use it, at least until I render it to the screen.

 

Byes!!