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.

Newcomers DBPro Corner / i need help with advanced gravity

Author
Message
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 23rd Dec 2005 01:00
I need help with gravity. I need to
jump and slow down as i near the height of my jump
land on a different y coordinate according to heightmap and objects
have shock motions when landing(the problem is the y coordinates on which to start the motion)
I also need to know how to activate down gravity at the height of the jump
do you have to do something like

I know it wont work like that. Also how do you use the force chainsaw on an object?
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 23rd Dec 2005 20:02
fine... i guess i can figure out the rest of it on my own but i still dont get how to land on land thats not just straight. Also this is really unrelated to jumping but how do you give different textures to the same heightmap and blend them together?
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 24th Dec 2005 08:38
I dunno about heightmaps (I usually use matrix or .X models).

But for the gravity:

Most people use a variable named YSpeed#. Which is, obviously, the speed upwards. When negative, it goes down, when positive, it goes up.

Now, the gravity is a vector that pulls our object down, when the object goes up, it slows down and edventually will accelerate downwards. This means our calculations would be something like this: dec YSpeed#, gravity#.
(Usually gravity is a constant)

If the object hits the ground, a new force works on the object, normal force, which is always -ForceDownwards (-Fz). In other words, the yspeed gets increased by itself, which gives 0.

To effect the gravity on the player, you have to increase the players position y with the YSpeed#.

You get something like this:



To jump, the only thing you have to do is increasing the YSpeed (in other words, make a vector upwards)
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 24th Dec 2005 21:23 Edited at: 24th Dec 2005 21:29
Thanks for the tip. better than my other bulky one which... im not sure even works o.o

I understand the gravity now but i still dont get movement over terrain. I never use .x models so could you tell me how to control the height and stuff on .x terrains?
i know for heightmap its something like
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Dec 2005 14:22
For .X terrains, I'd use Sparky's Collision DLL. Raycast from 0 to the highest height of the model, and it will return the intersection point.

Login to post a reply

Server time is: 2024-09-24 11:25:51
Your offset time is: 2024-09-24 11:25:51