Oi!!! What a waste of time!
I finally figured it out!
And it was something I never
ever
would have guessed....
What a pain!
C o m e o n g u y s !
Why do you do these sort of things and never document them??!?!?!?!?
Ridiculous!!!
Do you want to know why the 'sample' terrain works and YOUR PROGRAM DOESN'T work with the gdk terrain commands!?!?!?!
Probably because you do things in an organized way like I do and keep track of your objects with some sort of system.
Well I do and it's quite simple.
I have variables called:
int nextobjnum = 1;
int nextbmpnum = 1;
int nextsndnum = 1;
etc.
And when I want to load an object I say something like this:
int spaceship = nextobjnum;
nextobjnum++;
dbLoadObject("spaceship.x", spaceship);
Well this is all fine and dandy and works perfectly and helps you keep track of your objects.
Well....
With every 'subsystem' inside DBPro and DGDK such as images vs objects the numbers can be the same - meaning - you can have an object=1 and an image=1.
WHAT THEY FAILED TO MENTION ANYWHERE I'VE EVER SEEN (sorry for yelling but come on, this is such a waste of time for me and for COUNTLESS OTHERS it seems when I look through the forums) is that the so-called 'advanced terrain engine' uses up regular db 'object numbers!!!!!'
GRRR!
Why couldn't they just have dropped in a little tidbit of info in the help file somewhere saying something like:
'Hey guys, the reason we use 200 for the skybox in our terrain demo isn't just because we think 200 is a nice fancy looking number for a skybox, but it's because unbeknownst to you, object numbers 1-199 seem to have been taken up by the terrain.'
/calming down
/rant ending
Sorry I got a bit upset there, but it just seems like such a simple thing for them to 'mention' somewhere. Like I said, every other 'sub-system' of the DBPro and DGDK use their own numbering system. So you can and do have a matrix 1 and an image 1 and an object 1. Why does terrain have to be different and share objects, and why didn't they mention it??
I've been reading everywhere trying to figure out what was causing my issues with getting the terrain engine to work and keep running across similar posts from people saying things like 'hmm my skybox seems to blink in and out of existence'. Well this wasn't because of dbSetCameraRange issues as people suggested, it was because the poor guy used something like a 1 for his skybox object, and the terrain engine was clobbering it.
So to summarize: (lol)
-The terrain commands do indeed work in the GDK.
-...with one slight glitch: they use up an unknown number of 'objectIDs' without telling ya.
-The fix to your woes with terrain in GDK?
Make your handy 'nextobjnum' variable or your GetFreeObject() function start with a number that is at least 200!
Ok, I've wasted enough time on this. And so have many other people I'm SURE of it. (I've literally spent probably the last 4 hours solid trying to get it to work, and last week probably another 4 hours, when all they had to do was tell you that you shouldn't expect it to work like MakeMatrix(1
Grrnight
World Famous 3D Screensavers
-- http://www.vrman3d.com --