Sign in to follow this  

Why dont my windows and door show? 3D XNA model

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

So i downloaded a .x model from turbo squid and put it in my program to learn better about 3d graphics. I got it positioned and scaled (about) but the windows (all of them) and the door are black. The jpeg textures it came with have a door and window texture, but neither will go on the house model. So question #1: How can i get the door and window to show on the model? Question #3: Id rather have transparent window and door instead, will 255,0,255 rbg work for models? If i clear the window texture to 255,0,255? #4 The compiler told me error because i tried to load a picture thats not a multiple of 2 lol. Can i fix this instead of resizing the image and making it look uneven (i did that now it loads)? And Question 5; When i position the house it wont go exactly where i want it (Y position). My ground is y position=5. I have to use Y position =7 on the house to get it nearest to the ground (slightly below). If i try to use a decimal IE 6.5f, nothing shows on the screen. Is there any way to get it right on the ground where it should be so it looks better?

Share this post


Link to post
Share on other sites
We'd need to see code as to why your positioning isn't working.

It sounds like all your problems stem from the textures not loading. The error means every texture must be a power of 2 in dimensions. You could simply resize them and that should work. Whether or not the texture coordinates will still line up is another issue. It sounds like they are drawing but are drawing black. So this should fix questions 1 and 4.

As for transparent windows, you should be able to make the texture semi-transparent and then your door or window will be semi-transparent. The problem will be draw order because you will have to ensure that your semi-transparent objects are drawn after your opaque ones. This is not something that the standard Model class will do for you.

Share this post


Link to post
Share on other sites

This topic is 3740 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this