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.

Dark GDK / Some Map/Terrain collision/camera/sprite help.

Author
Message
System error
16
Years of Service
User Offline
Joined: 23rd Jul 2008
Location: UK
Posted: 23rd Jul 2008 19:40
Hey guys, I'm new to this forum so firstly "It's nice to meet you all".

I also am new to the "Dark GDK", and would thus just like to ask a few questions, that is, I've managed to understand how to create terrain/textures and use maps etc, and also use the camera to move around.. but I guess my question is more to do with "Collision Detection" and setting the camera and for example so it will decrement the (v) velocity rather than continuing going up making it appear it's flying. I've managed to do the inverse of that but when I try to do it up-wards it seems to really mess-up the Cartesian co-ordinates making them go in reverse etc.

I mean my I program to a respectable level in C, C++ and Java, and also have a reasonable knowledge in Maths/algebra 'n' Physics so one would imagine it's more of a problem with the SDK/API it's-self... as I said I am pretty new to the Dark GDK so if this question(s) sounds a little cryptic then I apologize in advance.

P.S, will using a sprite help solve this issue?

http://virtualworld.synthasite.com
cazub
16
Years of Service
User Offline
Joined: 29th Jul 2008
Location: here
Posted: 30th Jul 2008 00:54
i kinda answer'd this for somebody else so i can kinda answer it for you too,

if you have an object and position it at cartesian coordinates , lets say my object 1
you first set up velocities for the axies, like vX, vY, vZ, the only one you need really deal with though is vY.

in my code i havea jump command that works like this:

GameLoop(){
... //some code
onJump(){
dy = dy + 10;
}
... //somemore code
dbObjectPosition( x , (y + dy), z);
// then add some gravity
dy = dy - .8;

//then check for collision, mine just collides
// when the y coordinate hits zero and stops.
if( y < 0)
{ dy = 0;
y = 0;
}
...
} // END GAME LOOP




Now heres my question, how do i instead of just stopping at y = 0 can i make my camera stop when ti collides with my terrain? Right now the dbCameraAutomaticCollisionON() makes it so my camera can't "walk" around on the terrain, i have to continually hit jump to move around. Its like it gets stuck on my terrain. I've try'd moving the terrain down and shrinking the camera collision radius but it doesn't work, i'm still just stuck. ANy ideas?

hey doods

Login to post a reply

Server time is: 2024-09-30 03:15:48
Your offset time is: 2024-09-30 03:15:48