Tag Info

New answers tagged

2

So this doesn't provide details to every problem you'll encounter with your approach, but, if you want to map each vertex to the closest non-air voxel in order to scrape information from it (such as which texture to sample), here's a proof for the efficient method I came up with: For any given marching cubes vertex, we wish to select a voxel with which ...


0

Part of what you are looking for is an understanding of map or sphere projections. http://en.wikipedia.org/wiki/Map_projection A rectangle is not a sphere. (I know it's obvious, but useful to state.) To map a rectangle onto a sphere, you have some choices about how to do it. Your picture looks like it's an "equirectangular" mapping, which maps vertical ...


1

Expressed as a GLSL fragment shader (untested): const float M_1_PI = 1.0 / 3.1415926535897932384626433832795; const float M_1_2PI = 1.0 / 6.283185307179586476925286766559; uniform sampler2D texture1; varying vec3 v_normal; void main(void) { vec3 n_normal = normalize(v_normal); vec2 texture_coordinate; texture_coordinate.x = 0.5 - ...



Top 50 recent answers are included