Sign in to follow this  

Rendering Objects on Terrain (C++/DirectX)

This topic is 4648 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, I'm kinda embarrassed to be asking this as I've been programming for 4 years and am having such terrible trouble over such a simple thing. Anyway, I've been reading Introduction to Game Programming with DirectX 9.0 and Advanced Game Programming with DirectX 9.0 etc. However, Using the sample code "Terrain" given with the Introduction book, I cannot seem to render my own .X file onto the terrain. I've tried as many things as I can think of, I presume it has something to do with the lighting. Anyway, my source code can be found at http://www.dxn.siteburg.com/Terrain&Model.zip. It's meant to be compiled with VC++ 7.0 (that's what I'm using anyway). All help would be greatly appreciated :D I apolagise for the applauling mess the code is in. Regardz :)

Share this post


Link to post
Share on other sites
hello

I can help you, but not based on the information you've provided. I know its not what you want, but a lot of people do not have the time to download your archive and work through all your code. Especially so if you say "I apolagise for the applauling mess the code is in."... sad, but true.

If you want ideas, or better yet, solutions and answers:
- specific lines of code
- specific error codes/descriptions
- reproducable errors
- screenshots of problems (if graphical)

Quote:
I cannot seem to render my own .X file onto the terrain.

What exactly do you mean?
- does it appear, but not in the correct place?
- does it just not appear at all?
- does it appear, but all black / incorrect colours (referring to your "something to do with the lighting" comment).

Provide some more specific details and you might get the sort of answer you're after [smile]

Cheers,
Jack

Share this post


Link to post
Share on other sites
maybe its the scale of the .x file.

example: your terrain is being drawn between -100.0f and 100.0f in both directions (x/z or whatever you use) but in your .x file, one poly is that big.

If its too big, you will be inside the object and the polys will not show. Just a thought. Simple check is to turn back-face culling off.

I had that problem once. Thats what I get for "borrowing" models.

edit: or the opposite could be true.

Share this post


Link to post
Share on other sites
Thanks, I was just thinking, to also help solve my problem. Does anyone know of a tutorial, or some source code I can look at that has a terrain and a model on it?

Regardz :)

Share this post


Link to post
Share on other sites
Hazaah! I can sorta see a black blob now and my fps is 8.***** lol. This is good, hopefully I can work something out from here. Stay tuned. And thanks to both of you :D But rest assured, this is not the last of my n00bish problems :P

Regardz :)

Share this post


Link to post
Share on other sites

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