Geospheres - The better sphere

Blitz3D Forums/Blitz3D Programming/Geospheres - The better sphere

Ziltch(Posted 2004) [#1]
I have been working on getting a geosphere created in blitz.

A geosphere spreads it vertices evenly over the surface unlike the CreateSphere () command that tris get smaller the closer to the top/bottom.

I have got a geosphere of sorts going but I am have problems on how to texture it!

If any one has any ideas that would be great!

Has any one else worked on creating these?


GEOSPHERE (Work in Progress)



jfk EO-11110(Posted 2004) [#2]
I didn't do this myself yet, but I think I would first try to UV-map it by using the 3D coords of the vertices, shifted to values between 0 an 1.0. Since you can set UVW, this should be easy. At least if Blitz really utilizes UVW and doesn't ignore W - which I am not sure right now.


slenkar(Posted 2004) [#3]
you can just download wings3d and use the create geosphere option,
The problem with geospheres is that they dont unwrap to a square shape unlike spheres.


ZombieWoof(Posted 2004) [#4]
If you subdivide an icosahedron, your verts are always evenly spaced, and the sphere breaks down naturally into 2 poles and an equatorial strip.


ZombieWoof(Posted 2004) [#5]
Here is a quickie I did to gen an icosahedron and subdivide it

cursor to move around... "S" to subdivide the mesh

The code generates a mesh with 3 surfaces.. north pole, south pole, and equator... should be easy enuf to texture :)




Ziltch(Posted 2004) [#6]
Thanks ZombieWoof that code looks like it may do the trick.

Using a icosahedron creates a much better layout of the final triangles.


big10p(Posted 2004) [#7]
I had to run that code just to find out what an icosahedron is! :P


ZombieWoof(Posted 2004) [#8]
the initial coords of the icosahedron are wrong -- someone want to fix up the math ??


koekjesbaby(Posted 2004) [#9]
use spherical mapping: http://membres.lycos.fr/amycoders/tutorials/tm_approx.html


Dirk Krause(Posted 2004) [#10]
Use an icosahedron

and try wilbur:
http://www.ridgenet.net/~jslayton/software.html


slenkar(Posted 2004) [#11]
can someone do a tutorial for newbies in the tutorial section??
PLEASE!


Ziltch(Posted 2004) [#12]
ZombieWoof :
Have you been here ?
http://astronomy.swin.edu.au/~pbourke/polyhedra/platonic/

I used a tetrahedron then a cube as it was easier as a starting point to get by brain around the problem. Getting it working with a Icosahedron would be perfect.

Dirk:
Wilber looks like a great prog for creating maping textures. Have to see what it can do.


ZombieWoof(Posted 2004) [#13]
Nope -- didnt find that one -- but its got the math I need -- will give it a shot and update the code if it works


ZombieWoof(Posted 2004) [#14]
Corrected icosahedron code



btw == how do folks to the code in the scrollable textarea ??


Ziltch(Posted 2004) [#15]
That looks amazing.

Now to get a textures uv's working and that would be the best sphere creating I have seen in Blitz!

I do not understand what
"btw == how do folks to the code in the scrollable textarea ?? " means . Sorry!

Slenkar: What kind of Tute do you mean?


Perturbatio(Posted 2004) [#16]

btw == how do folks to the code in the scrollable textarea ??


use <codebox></codebox>


Beaker(Posted 2004) [#17]
You know this code:
		While Not KeyDown(31)
		Wend
should be:
		While KeyDown(31)
		Wend

Surprised no one has noticed it.


Ziltch(Posted 2004) [#18]
I had changed it a keyhit(31) but forgot to mention it!


ZombieWoof(Posted 2004) [#19]
@master: thanks for the bugfix :)

@zitch: since the new code messed up my poles+equator setup, I've gotta go figure which triangle is which and reassign the them to the right surfaces... then it'll be a lot easier for me to setup the u/v

New version with surfaces fixed, colorized:




ZombieWoof(Posted 2004) [#20]
having a problem getting ultimate unwrap to deal with the mesh... apparently the b3d writer in makeb3d is a little broken


ZombieWoof(Posted 2004) [#21]
hehehe ultimate unwrap does geospheres using icosahedrons, plus exports b3d :)


ZombieWoof(Posted 2004) [#22]
here is the map I finally came up with

couldnt get it to do the equator the way I wanted.. might have to gen my own u/v to get what I want




slenkar(Posted 2004) [#23]
the community needs a tutorial on the easiest way to get a single image onto a geo-sphere in either blitz or ultimate unwrap.-seamless of course


Ziltch(Posted 2004) [#24]
ZombieWoof:

Did you figure out the UV's ?


ZombieWoof(Posted 2004) [#25]
Nope -- I cheated and grabbed a copy of Ultimate Unwrap after adding code to save the mesh to B3D :) Was kinda busy getting the alpha release of Game Manager ready to post.

And now of course I'm off on other things :)

There are some recent posts on uv mapping if you want to take a shot at having the code generate the UV data... and we've suggested a couple of different mappings in this thread.


Ziltch(Posted 2004) [#26]
I ended up finding an example in on how to convert a texture to a spherical map.

With this function you can then use a CreateSphere then texture it with the new texture and it look great!

I got the code from Paul Bourke's cool site
http://astronomy.swin.edu.au/~pbourke/texture/polargrid/

I will post when it is working.

Thanks all for the input


podperson(Posted 2004) [#27]
Spheres suck. Why couldn't the world have been a torus?


slenkar(Posted 2004) [#28]
that would be awesome if you could get that sourcecode - everyone needs this