|
Author Topic:   I want the world..
Effin Goose
Member
posted July 03, 2000 12:00 AM            
Hey..

Bulletin Boards been a bit quiet for a few days so I thought I'd post a topic i have been thinking about lately..

Ok, I've got the terrain thing down pat, and in that respect all is well, but what i really want to do is to change this flat plane the terrain rests on, into a sphere, or a "planet" if you will.. now a couple of problems that come from this is how to get a terrain to map to my "planet".. I originally thought of using 6 terrain maps and forming a cube, and use some sort of curve function like beziers or something to make it appear more rounded..

this however would still look pretty cubish and lead me to wonder what geometrical shape wraps around a sphere? does anyone know? and if you do why wont you tell me.. And does anyone have any other idea's on how to store vertices for this so called "planet"?

Ryan

------------------
I dont like it, and Im sorry I ever had anything to do with it
- Schrodinger

IP:

Cthulhu
Member
posted July 03, 2000 07:18 AM            
Maybe you could use planar heightmap for terrain and 'bend' vertices using sphere equation or something. The problem is to merge heightmap edges nicely. Of course this method also requires modification of possible LOD-computations.

IP:

Pedro Estrada
New Member
posted July 05, 2000 09:17 AM            
Nothing planar is going to wrap perfectly around a sphere, ask any cartographer. You can try several different approaches to map your planar terrain onto a sphere though. One approach is to represent your sphere as using parametric equations in U,V, there will be problems as the spacing of vertices increases towards the poles.

Another approach is to represent the mesh for the sphere as a geodesic, and come up with a mapping to the geodesics vertices.

Something similar to what you are suggesting with the subdivided cube is to use a spherical quadtree. I saw it mentioned in some NASA literature for GIS modelling of Mars or something. I haven't investigated this, but it might be cool.

------------------
Pedro Estrada

IP:

Revolver
Member
posted July 05, 2000 01:05 PM         
Off the top of my head, why not take a point, and generate height values in 360-degree increments around it? The granularity here would depend alot upon scale, as well as preference.

It's a lot of values methinks - for N-sized increments, you would have to generate around (N^N)-((N*2)-2) height values.

Imagine splitting a sphere with a circular plane (with a radius larger than the sphere). Now duplicate this plane, and rotate this by N degrees. Repeat (using the same axis of rotation) until you've created a plane for every rotations position is max(Rot,N)%min(Rot,N)=0. Generate height values every N degrees along the curving edge of these planes.

AFAIK this would work very much like a standard "non-curved" bit of terrain.

Actually, now that I think of it... I remember looking at the terrain engine presented by the Westwood boys at GDC, and it supported curving terrain (sort of =P).

It SHOULD be here, but it's coming up 404. I have a copy at home, and I'd be willing to send it on over to you when I get off work.

IP:

Effin Goose
Member
posted July 05, 2000 07:46 PM            
Ok, couple of questions.. Pedro, whats a Geodesic? Well, when i say questions i actually mean one question..

Revolver, what you say sounds alright, except i was thinking about it, and with this method, wouldnt there be a lot of vertices that are very close to the poles of the axis about which you rotate the plane?

I do actually already have that file, however i've never run it as i have a voodoo and it doesnt support textures larger than 256x256 (the file uses 1024x1024).. I'll go and have a look through the source now anyway..

Ryan

------------------
I dont like it, and Im sorry I ever had anything to do with it
- Schrodinger

IP:

Joachim
New Member
posted July 06, 2000 03:58 AM            
hi,

geodesic sphere: a sphere where all vertices are evenly spread over the surface.

the construction of the thing: you do it iteratively. wrap around a cube or whatever your mesh of triangles (having N vertices of course)
do
set_distance_vertices_to_center(radius);
get_mean_length_of_triangle_edges(all_edges);
get_max_deviation_of_triangle_edges(all_edges);
move_edge_vertices_towards_mean_length(all_edges);
while(max_deviation > precision);

hope this helps...

[edit]
oops. forgot to tell you about the texturing... use a tool like photoshop or paintshop to transform your world texture into one where the latitudes are stretched so that the poles are stretched across the entire top and bottom, and the equator also spans the entire width. I guess your texture already looks like that (it's like a standard map in your atlas).
Unwrap your geodesic sphere to a plane using polar coordinates, and map them onto your texture. each vertex position now corresponds with the uv mapping for the texture.

progressive meshes and this mapping: in progressive meshes, you introduce or remove vertices according to your need for detail. Whatever technique you use for this, you'll end up with a couple of vertices on the sphere which you want to texturize. All you have to do is transform them back to uv coordinates by representing the vertices in polar coords, like stated above.

if you have any question, mail me..
[/edit]

jr

[This message has been edited by Joachim (edited July 06, 2000).]

IP:

Pedro Estrada
New Member
posted July 06, 2000 08:41 AM            
I think Joachim defined a geodesic pretty well, here is a link with a mathematical description plus picures: http://mathworld.wolfram.com/GeodesicDome.html

And to clarify, you can't evenly distribute points or vertices on the surface of a sphere, you can only hope to achieve an approximately uniform distribution. Check: http://www.math.niu.edu/~rusin/known-math/95/sphere.faq for more info.

For actual code check Paul Bourke's excellent site: http://www.swin.edu.au/astronomy/pbourke/modelling/sphere/

IP: