Viridian
05-11-2006, 12:16 PM
I'm working on my second game, a space-opera RPG called Star Revolution. I'm taking games like Starflight and Star Control II as my inspiration. Thus, I'm going to have a bunch of planets for the player to visit and explore, and the player will be able to travel all over any planet he visits (instead of the planet simply being abstracted to menus like in Privateer or Elite).
So I need spinning globes for the planets in the outer-space, 3D view. This is my first 3D game, and while I'm not completely unfamiliar with 3D concepts, this is the first time I've tried to implement them.
But when the player lands, the planet will be presented in a more traditional, top-down "tiled" RPG view.
What I am trying to do is use the same texture for the 3D and the 2D surface view. Why am I trying to do this?
Back in the mid-Eighties when I played Starflight, I was very impressed with its landing sequence. Starflight presented a planet as a rotating sphere, but when you landed, the view shifted and you saw the patch of planet you were landing on as a heightfield. If you looked very carefully at how the heightfield was colored, when you actually emerged onto the surface of the planet (now presented in 2D) you'd notice that the pattern of height colors was exactly the same, proving that the game used the same data for its 2D and 3D views. That really added to the verisimilitude of the game to me, and I want to do the same in Star Revolution.
I understand that textures designed for use on spheres typically have to be stretched (http://astronomy.swin.edu.au/~pbourke/opengl/sphere/earth.gif) at the top and bottom to compensate for the "pinching" at the poles of a traditional banana-peel sphere (http://astronomy.swin.edu.au/~pbourke/opengl/sphere/quads.gif). I don't want to have to do this, since I want the 2D view to effectively be the same texture, only now mapped on a grid instead of a sphere.
I was thinking hard about this problem when I remembered the icosahedron, or 20-sided figure. I had seen planetary maps in RPGs like GURPS Space and Megatraveller represented by icosahedron shapes that had been flattened (http://upload.wikimedia.org/wikipedia/en/8/83/Icosahedron_flat.png). I think with some clever UV coordinate jiggering I might be able to make that work...I would have some parts of the texture that were "dead" or unused in the 3D view but if I work around that limitation I might get the look I am working towards.
I have two problems:
1. An icosahedron doesn't have enough sides. I want a spherical shape composed of equilateral triangles, like an icosahedron, but with more sides so that it approximates a sphere better. I'd need the this shape in a 3D format that includes both the vertices and their normals, of course. Number of 3D modelling programs I have == zero.
2. Once I had such a shape, I'd have to find a way to "unwind" it so that I can properly map the UV coordinates, and I have no idea how to do that.
Basically, what I'm asking is, has anyone here ever done ANYTHING like this before, and if so, could you give me some tips?
So I need spinning globes for the planets in the outer-space, 3D view. This is my first 3D game, and while I'm not completely unfamiliar with 3D concepts, this is the first time I've tried to implement them.
But when the player lands, the planet will be presented in a more traditional, top-down "tiled" RPG view.
What I am trying to do is use the same texture for the 3D and the 2D surface view. Why am I trying to do this?
Back in the mid-Eighties when I played Starflight, I was very impressed with its landing sequence. Starflight presented a planet as a rotating sphere, but when you landed, the view shifted and you saw the patch of planet you were landing on as a heightfield. If you looked very carefully at how the heightfield was colored, when you actually emerged onto the surface of the planet (now presented in 2D) you'd notice that the pattern of height colors was exactly the same, proving that the game used the same data for its 2D and 3D views. That really added to the verisimilitude of the game to me, and I want to do the same in Star Revolution.
I understand that textures designed for use on spheres typically have to be stretched (http://astronomy.swin.edu.au/~pbourke/opengl/sphere/earth.gif) at the top and bottom to compensate for the "pinching" at the poles of a traditional banana-peel sphere (http://astronomy.swin.edu.au/~pbourke/opengl/sphere/quads.gif). I don't want to have to do this, since I want the 2D view to effectively be the same texture, only now mapped on a grid instead of a sphere.
I was thinking hard about this problem when I remembered the icosahedron, or 20-sided figure. I had seen planetary maps in RPGs like GURPS Space and Megatraveller represented by icosahedron shapes that had been flattened (http://upload.wikimedia.org/wikipedia/en/8/83/Icosahedron_flat.png). I think with some clever UV coordinate jiggering I might be able to make that work...I would have some parts of the texture that were "dead" or unused in the 3D view but if I work around that limitation I might get the look I am working towards.
I have two problems:
1. An icosahedron doesn't have enough sides. I want a spherical shape composed of equilateral triangles, like an icosahedron, but with more sides so that it approximates a sphere better. I'd need the this shape in a 3D format that includes both the vertices and their normals, of course. Number of 3D modelling programs I have == zero.
2. Once I had such a shape, I'd have to find a way to "unwind" it so that I can properly map the UV coordinates, and I have no idea how to do that.
Basically, what I'm asking is, has anyone here ever done ANYTHING like this before, and if so, could you give me some tips?