shazow / fractal_planet

A store of random OpenGL projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fractal planet

Requirements: GLEW, glfw, glm, libnoise

Generate a spherical object using libnoise to perturb the surface. There are 2 different mappings of vertex data to the sphere. The first use a naive polar coordinate mapping. This causes alot of clustering near the poles of the planet. The second takes a cube and attempts to morph it so that it maps to a rough approximation of a sphere. I find this method gives a more even spread of vertices and a nicer looking planet.

By default running the program will generate a planet using polar coordinates. If you pass in the arg 'c' to the program, it will switch to using the cube mapping method.

Polar coordinates: Polar coordinates screenshot Polar coordinates screenshot

Cube mapping: Cube mapped screenshot Cube mapped screenshot

About

A store of random OpenGL projects

License:MIT License


Languages

Language:C++ 99.3%Language:C 0.7%