Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Matrix throws camera off the surface

Author
Message
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 31st Oct 2003 04:03
Hmmm, cant seem to get a handle on why its doing it to me, but heres the scoop:

Make flat matrix, texture it, run camera along surface using get matrix hieght to determine the matrix Y value. Everyhting runs good. Then I shift one point 100 units up to create a hill.
Now , when my camera reaches the hill, instead of calculating maty#+10.0 = new camera y value, i get wild camera values of anywhere from -9800.0 to +9800.0 across the grid tile that has been raised.

If i use the straight get height command to interrogate that raised tile I get the correct height values returned. For some reason the camera's y value glitches to extreme numbers. Weird!!

This did the same thing using random matrix. Any area of the matrix that was not its flat value, caused the camera to fly either way above or way below the matrix surface.

Any suggestions would be appreciated,...
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 31st Oct 2003 15:59
Let's have a look at your code - sounds like a very strange bug.


Van-B

hexGEAR
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 31st Oct 2003 16:14
yeah, sounds strange have you tried the get ground height command?

DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 31st Oct 2003 16:45
Yes,..oddly enough, when I use the get height command to test that tile and then print the value to the screen it reads the correct height value. Im new at this software so its probably something im overlooking or misinterpreting,...or its a very strange bug.
I have the latest version of dbpro, which I seem to read everywhere has some strange bugs introduced, thats probably not the case here. Anyhow, included please find the program code, which is just a mod of one of the example files.

DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 31st Oct 2003 17:57
ok I double checked osme other points in that raised tile section using the get height command and they come up with very odd level numbers as well. I must have picked the only point in that tile that gave back the right value before LOL. Anyhow, all other points around the one I raised return freaked out values,...is there some angle vector I have to set?
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 31st Oct 2003 17:58
Why not try it without adding the Maty# variable, like instead of:

position camera cx#,cy#+maty#,cz#

Try:

position camera cx#,cy#,cz#

It might be a variable bug, or maybe GETGROUNDHEIGHT already offsets the Y position of the matrice to suit. In DBC you'd have to do this if you were placing the matrice on different Y locations, but perhaps DBPro has changed in that respect.


Van-B

DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 31st Oct 2003 18:13
Hi,..thanks for the reply.

The offset with maty# was not in the program originally,..I added that in as a test to see if DBpro wasnt recalcing the 3dworld at the matrixs position. It doesnt , by the way, you have to offset to the matrix "zero" location as reference.

Also, using the get height command directly on some of the points in the tile, other than the one I raised, results in very strange height values. I suspect some vector is missing to check for ground angle in the event one point is raised.

However, as spec'd in the manual, we are suppose to be raising the four corners of the tile, however the command allows us to target and raise anypoint on the matrix. Maybe the fact that im raising a point other than a corner point throws the get height command off. Hmmmm perhaps I have to target only the 4 corners and raise only those points to make the calculation work properly?? Ill give it a try.
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 31st Oct 2003 18:15
Well, everything works for me. I press Ctrl, area under me raises 100 units. I move around hill, height=0, as I move up hill, height goes up until I reach top which = 100.

Are you SURE you are running latest patch 5.1b

Earlier patches had problems where areas around around hills were showing negative heights and another patch causes ALL heights to be inverted. This was fixed ages ago.

Boo!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 31st Oct 2003 18:19
You ARE raising a corner. Your matrix is split up into a big grid 64*64 tiles (these are numbered 0-63). There are 65 vertices labelled 0-64 that you can raise. You are rasing corner 32,32 which is perfectly acceptable. get ground height lets you get height at any position from 0-12799

Boo!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 31st Oct 2003 18:29
Could you try this aand see if it works. It demonstrates moving around a hilly matrix



Boo!
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 31st Oct 2003 18:52
spookies code works great for me!


Go on, click on my signature image, you know you want to
Favourite smiley>>>
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 31st Oct 2003 22:00
YES!! hehe that did it. Looks like I was running an older version of dbpro. However, after upgrading I couldnt get anything to run at all so I downloaded and reinstalled the ATI radeon 9.2k drivers and everything works great now.

Very smooth,..and I can even run your demo matrix.

Thanks for the help gang,..much appreciated!!

Login to post a reply

Server time is: 2026-07-26 13:02:07
Your offset time is: 2026-07-26 13:02:07