|
|
|
#1 |
|
M.D.
Join Date: Dec 2002
Location: Shelter
Posts: 4,058
|
Am I trying to do the impossible? (3d guru's apply)
http://soap.com.au/chris/rotateTest/v3/
keys to rotate the sphere. What I'm trying to achieve is convert a 2D array of hexagons wrapped around a sphere. here's the map: ![]() I believe that this is impossible as spherical coordinates get squished at the poles. Guessing that If this was a cylinder it would work. I'm also guessing that the spacing between hexagons is different on the x/y axis because of this squishing. Is there any way to resolve this? maybe a hexagons size can be changed to be smaller the closer it is to a pole? I'm not so sure how to go about doing that. Maths aint so good. thanks for any help you guys can give me
|
|
|
|
|
|
#2 |
|
Student
Join Date: Apr 2001
Location: -
Posts: 4,756
|
texture mapping is quite a strong interest of me (e.g my recent UV-scripts)
unwrapping spheres has always been kind of a paradox as it always comes with side effects see (sphere with cheker map and earth texture) http://www.unwrap3d.com/tutorial_map.aspx which are a better example. but maybe you need a different shape? - from what I saw in the demo maybe something like this would work as well? ![]() based on 2 circles of faces merged together in the 2nd model. Green shows the seams of the UV- map (where your texture stops and could produce a seam depending on your texture, less or not noteable ones are better). At the bottom is the UV- example of that 2nd model with way to much texture space waste. Just to give you more ideas something else I found, for the math approach (not my turf) http://tobias.preclik.de/codeblog/?p=9
__________________
my new home: polycount old: Curing C. tech | Curing C. designs | tank | ortho. | zelda LTTP | Tile Edit. | scrolling 3d: 3d engine kit | ASE format | 3d binary format |
|
|
|
|
|
#3 |
|
RevoGen Studio's
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 788
|
I don't think that doing the hexagons ALL around the sphere is possible...
I'm not too sure at the moment about exactly how the geometry fits together, but you can make an IcoSphere with triangles, or maybe pentagons. Anything with a higher edge count is out of the question. Or then again, you can texture map that onto a sphere, after (probably should check out that link render posted last) you run some calculations on the texture image to stretch out the 2 ends of it, so it texture maps perfectly, like they have those world maps stretched out at the top and bottom! P.
__________________
WIP-OpenFL library I love vegetarians! More meat for the rest of us! |
|
|
|
|
|
#4 |
|
M.D.
Join Date: Dec 2002
Location: Shelter
Posts: 4,058
|
thanks for the reply's. Render, I don't think I can use that method of shapes, the setup I have now is just a test scenario, imagine if a hexagon could appear anywhere on the sphere.
Basically what I'm doing right now is: getting a 2D array of id's which represent the hexagons. loop over the array, convert 2d array indexes to 2d hex coordinates find the percentage of this coordinate in relation to a map size (px = hexX / (hexW * arrayW), py = hexY / (hexH * arrayH)) find the point on the sphere using this percent and the 2:1 ratio (sx = px * 360, sy = py * 180) convert this angle to spherical coordinates create hex polygon at this coordinate. there is no texturing going on here. Hexagons are individual geometry in 3d space. so yeah, unless somehow I can do hex to spherical to polar coordinates, or something like that, treating it like a texture map which has been creates for a sphere. Its not going to work. on thew topic of spherical texturing, does anyone know how to take a flat image (like the one I posted) and move the pixels so the tops and bottoms are expanded and the middle is squished, so that it maps correctly around the sphere? Thanks for the help. |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jul 2007
Location: Columbus, OH.
Posts: 465
|
I think euler's formula for polyhedra indicates it can't be done, at least not with a texture that's a regular tiling of hexagons (ie each vertex having valence 3).
For any genus G polyhedron you must have V-E+F=2-2G, where V is the number of vertices, E is the number of edges and F is the number of facets. The sphere (and any polyhedron homeomorphic to a sphere) has genus 0. But if you consider the regular tiling of hexagons in 2D, if you have F hexagons then you have 6F/2 edges (each hex has 6 edges but we double counted them because each edge is shared among two hexes). Also, the number of vertices is 6*F/3, each hex has 6 vertices and each vertex is shared 3 ways. Plug these numbers into eulers formula: V-E+F = 2-2G 6F/3-6F/2+F = 2-2G 2F-3F+F = 2-2G 0 = 2-2G G= 1 So when you tile regular hexagons like that you can only make genus 1 shapes - a torus. You can envision this tiling by taking the texture and wrapping it up into a cylinder, then rolling that cylinder back onto itself. You won't be able to texture or facetize a sphere seamlessly with hexagons unless you have some nodes with valence!=3. (Vertices like that are called extraordinary points in subdivision surfaces - in the infinitesimal limit they have weaker curvature guarantees that the other spots on the surface). // brain.explode();
__________________
Completed games:Mind Maze (48 hour job), Puzzle Kaboom, Pinball Racers, Spice Hunters Ongoing Projects: Doom-a-like, Quake-a-like, updated Feb. 4 '09 About me: Homepage. Last edited by rachil0; 02-10-2009 at 10:35 PM. |
|
|
|
|
|
#6 |
|
M.D.
Join Date: Dec 2002
Location: Shelter
Posts: 4,058
|
thankyou rachil I was gonna say the exact same thing
![]() you have made my day. |
|
|
|
|
|
#7 |
|
Adrian Seely
Join Date: Apr 2006
Posts: 28
|
Daag dont have anything productive to add, but im loving what people are making flash do these days, makes me want to bust out a 3d project!
|
|
|
|
|
|
#8 |
|
Student
Join Date: Apr 2001
Location: -
Posts: 4,756
|
I remember some demos from the flash 8 days when bitmapData and normal maps (displacement maps) were introduced showing some examples with a spherical displacement
it was not andre still he has a blog entry and demos as well: http://blog.andre-michelle.com/2005/...mentmapfilter/ another something I found: http://justin.everett-church.com/ind...es-on-spheres/ demo & code: http://makc.coverthesky.com/FlashFX/ffx.php?id=8 in the end I could not find the article anymore (quite scientific but it used displacement and some higher math to do very accurate sphere mapping from a stretched texture in Flash)
__________________
my new home: polycount old: Curing C. tech | Curing C. designs | tank | ortho. | zelda LTTP | Tile Edit. | scrolling 3d: 3d engine kit | ASE format | 3d binary format |
|
|
|
|
|
#9 |
|
Member
Join Date: Jan 2009
Posts: 90
|
I think rachilo is right, you can't form a solid using just hexagons without gaps-- i.e., every hexagon touches exactly six others along each face.
You could do it with a mix of pentagons and hexagons, but that would probably cause more problems than it solved (I assume). |
|
|
|
|
|
#10 |
|
Pumpkin Carving 2008
Join Date: Apr 2006
Location: Grand Rapids MI
Posts: 2,280
|
I tried this already, and unfortunately for you, working in the 3d perspective makes it impossible. Faking it from a static 2d perspective is completely possible though.
http://board.flashkit.com/board/show...ht=grid+sphere That probably doesn't help you now but there's some wisdom in that thread there.
|
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jan 2005
Location: Paris, France
Posts: 696
|
Isn't it a similar problem ?
![]() Maybe it would be possible to map the ball with hexagons if you use fake hexagons (6 sides but not perfectly symetric). |
|
|
|
|
|
#12 |
|
M.D.
Join Date: Dec 2002
Location: Shelter
Posts: 4,058
|
yep, thats possible, but how do you get the hexagon coordinates like that?
|
|
|
|
|
|
#13 |
|
n00b
Join Date: May 2002
Location: Sweden
Posts: 163
|
Don´t know if it helps, but try googling for "truncated icosahedron". That´s the nerd-word for a soccer ball.
|
|
|
|
|
|
#14 |
|
ism
Join Date: Aug 2001
Location: , location, location
Posts: 4,970
|
Again, don't know if this helps but this texture maps to a soccer ball using spherical coordinates (i think there might be a bit of a seam though);
__________________
Graphics Attract, Motion Engages, Gameplay Addicts XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro |
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Jun 2000
Posts: 2,741
|
Only the white sections of a soccer ball are hexagons. The black parts are pentagons.
;-) |
|
|
|
|
|
#16 |
|
RevoGen Studio's
Join Date: Sep 2006
Location: Ontario, Canada
Posts: 788
|
When I said you could texture map it on the sphere, I of course didn't mean that you would see no seems in it, but if you subdivide the triangles in the sphere enough, then that shouldn't matter too much. And of course, I got reminded by others just now about the Displacement Map Filter. I think that this will be your only alternative, but for rotation you'll have to work with moving the actual texture around in x/y's...
P.
__________________
WIP-OpenFL library I love vegetarians! More meat for the rest of us! |
|
|
|
|
|
#17 |
|
M.D.
Join Date: Dec 2002
Location: Shelter
Posts: 4,058
|
well, thanks for all the help and replies. I convinced people that it wasn't possible and now I'm using a flat texture map, with hexagons placed roughly around the equator. With tweaking hex size, amount around the equator, spacing, the results looks good.
can't show you guys anything yet though, stay tuned ![]() thanks again. |
|
|
|
|
|
#18 |
|
Student
Join Date: Apr 2001
Location: -
Posts: 4,756
|
I dug up today a nice page regarding this matter
http://www.maths.unsw.edu.au/school/articles/me100.html ![]() ![]() ![]() but propably you already fixed it somehow |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|