Jump to content
  • Advertisement
Sign in to follow this  
lougv22

3d model with extension x won't show up in xna 4.0

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

[color=#4A4A4A]I am working on simple XNA 4.0 game, my character which is an animated FBX 3D model draws and shows correctly on the screen, but my Skybox model (not-animated), which is in X format is not showing up. I have made sure that both the model and its corresponding texture are present in the correct locations in the Content project and while debugging it, it looks like it gets loaded correctly and its Draw and Update functions get called as they should. I just don't see the model on the screen, all I see is my character and a purple background:
[color=#4A4A4A]
Here is the content project:
[color=#4A4A4A]
XNA_TPS_Skydome_Content_2.png
[color=#4A4A4A]
and this is the code for loading the Skydome model (it's located in my LevelCreator class):
[color=#4A4A4A]
XNA_TPS_Skydome_Load.png
[color=#4A4A4A]
and here is how the Skydome model is being drawn:
[color=#4A4A4A]
XNA_TPS_Skydome_Draw_1.png
[color=#4A4A4A]
XNA_TPS_Skydome_Draw_0.png
[color=#4A4A4A]
And ideas why it wouldn't show up on the screen?

Share this post


Link to post
Share on other sites
Advertisement

I have a random guess. Is the model is so big that it's further away than the far clip plane?


Not sure, but it was definitely a scaling error. In order to fix I had to set the Scale of the model (in its Properties window) to 2 or higher, and add this line of code:

gameLevel.SkyDome.Transformation = new GameBase.Transformation(new Vector3(-210, 0, 10), new Vector3(0, 170, 0), new Vector3(3, 3, 3));

So now the whole thing looks like this:


// Sky
gameLevel.SkyDome = new SkyDome(game);
gameLevel.SkyDome.Initialize();
gameLevel.SkyDome.Load("Skydome");
gameLevel.SkyDome.Transformation = new GameBase.Transformation(new Vector3(-210, 0, 10), new Vector3(0, 170, 0), new Vector3(3, 3, 3));
gameLevel.SkyDome.TextureMaterial = GetTextureMaterial(game, "Skydome", Vector2.One);

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!