See it in action at https://pseudosun.ethanvoth.com! PseudoSun is very much a work-in-progress, so see below for instructions on how to use the program currently.
mouse
to look around and choose which direction you want
to go.WASD
keys to move forward, left,
backwards, and right, respectively.space
key to move up, and the
shift
key to move down.
W
key multiple times right before holding it down
to go faster. Each additional tap multiplies the speed by 2.E
key to toggle the menu.To manipulate and render the 3D geometry, it uses the Three.js 3D graphics library. This allows it to tap into the power of your graphics card directly from the browser (whenever possible).
The terrain consists of a heightmap of points on a (modified) plane. The height for each point is determined by layering various transformations of Perlin noise (generated using noisejs), which creates an organic, varied landscape. There is an ocean, which only exists at a defined sea level.
To reduce the total number of points that need to be rendered, polygons are rendered with higher density nearer to the camera and lower density farther away, before stopping entirely. To achieve this, we create a custom geometry using the following steps:
Steps 1-3 only need to be executed when the program is initiated, and step 4 only happens when the camera has moved into the boundaries of a new tile. (When the camera crosses a tile boundary, it is reset back the length of one tile so that the geometry can remain stationary in virtual space).
As of now, the sky is a simple skybox. I hope to improve this in the future by using shaders to simulate the scattering effects of the atmosphere.