Rendering Objects on Terrain (C++/DirectX)

Started by
5 comments, last by Benjo85au 19 years ago
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 :)
Advertisement
Can't anyone help me with such a simple question? :(

Regardz :)
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Thank you for the advice. The reason I didn't show particular lines is that it shows no errors. And the .X file does not show up at all.

Regardz :)
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.
::fart::
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 :)
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 :)

This topic is closed to new replies.

Advertisement