Sphere gravity and some other

Hello all,

I am starting a new project.
Sthg. like moonlander 3d.
But now i have some questions:
1.
how can i make the rocket to have always gravity to the center of an sphere(planet) like on earth or on the moon?

2.I want the heigh to be displayed on screen. with wich script could i do that?

3.When the rocket lands on an non-horizontale ground it would explode.
Any suggestions?

4.Do u know an tutorial which explains making (fast) terrains?

I would thank u for all ur answers!!!

To simulate spherical gravitation you need to add actuator with force defined. This force will be oriented towards centre of planet and its absolute value will be gravitation force in actual position. You need to actualize these force values every frame, when you spaceship moves.

You can display any text on screen using bitmap fonts. Try to find ttutorials on this. All you need is to define plane with bitmap texture for text, add Text property to it and fill this Text property with height value.

To detect collision on non-horizontal parts you can use different aproches. Define map, where you can safely land or check, how you land bounce after collision…

Fast and nice landscapes can be generated by Terragen.

what do u mean with terragen?

And does any1 know a script to calculate the heigh of an object to the ground?

www.planetside.co.uk/terragen

is it possible to use terragen in blender???

Maybe you should get some practise with Google… Anyway, here is link for Ter2Blend script: http://users.skynet.be/sky33676/ter2blend.html

Hee, cool. I also made a planet with a cube on it as character, and then let it navigate around de sphere (planet) But I added a empty in the center of the sphere, but when I do this, the character can’t go up or down, because when I set actor on it, the cube will fall off the sphere. :frowning: So I’ll hope someone will help you getting a gravety script or something else :smiley:

something you can try is parenting you object to the sphere…i remeber seeing this work somewhere but forgot…

If you set up a motion constrataint to an empty in the center of the sphere and have the controls for the game control the orientation of the empty, and not of the cube, THEN parent the cube to the empty, that SHOULD work. But honestly I’ve never tried any of this so I can’t make any guarantees.

Download this gravity demo, play it with Blender (use Space to get cube to move). It contains a little gravity script. I hope it helps.

Great, just a begin. You should fix some problems like the cube is always rotating when on sphere, and some unsmooth walk forwards like some little pauses when walking forwards. But when you fix this, the script should be very usefull :smiley:

JD-multi,

control of cube movement isn’t a part of script. It’s just a quick hack allowing to show gravitation effect. Script Gravity.py only computes gravitation force in every frame and aplies it on object.