Page 1 of 1

add buildings and trees to planet surfaces HELP!!!

Posted: 11.06.2002, 15:14
by carolinaguyyyy
I created a building in .3DS format and tried to orbit it in a circular orbit at the planets surface. The goal was to look out the buildings windows and watch the planets rise and set. But do to my lack of understanding of your orbit parametors the best i got was able to do was a low flying house that dipped under the surfuse now and then. :(

How do you set the orbit settings to hold an object at a given lat. and long. on a planet surface. Or better yet some code to do that for us dummies would sure be fun :)

Posted: 11.06.2002, 17:24
by Marc Griffith
I've tried something similar before. I managed to get it working for an object at the equator. I have no idea for other longitudes and latitudes, and i doubt its possible.
I had a 3DS model of some buildings orbiting the earth with its SemiMajorAxis equal to the radius of the earth.


Code: Select all

"Building" "Sol/Earth"
{
   Mesh "building.3ds"
   Radius   2 #kilometers
   CustomOrbit "building"
   EllipticalOrbit {
      Period          1
      SemiMajorAxis    6378 #radius of the earth
       }
}



There are two things that will cause trouble.

1. Celestia re-calculates the center of each mesh when it is loaded. This will cause your building to be rendered with half of it underground. I modified the celestia code to disable this. You can get around this by mirroring your entire 3ds model, (the mirror will be underground).

2. Celestia is not designed to handle drawing any objects that are close to each other or are overlapping, it doesnt need too. The soloution has something to do with sharing depthbuckets (openGl stuff). Because of this your models will dissapear when too close to the earth at all but a few viewing angles.

The second point is the one that kills your idea. The code responsible has been commented by Chris (render.cpp I think) you'll have to ask someone with some OpenGL nouse to modify it.