max-mapper / voxel-engine

3D HTML5 voxel game engine
http://maxogden.github.com/voxel-engine
BSD 3-Clause "New" or "Revised" License
1.29k stars 220 forks source link

non-cube voxels? #107

Closed ctzurcanu closed 9 years ago

ctzurcanu commented 9 years ago

Any chance to display and collision-mesh voxels with one longer axis? I have here a sampled object (by slices), but the distance between the slices is about 1.5 "length of pixel". To have this voxel space displayed at the right ratio I would have to stretch the cubes of all voxels.

Is this possible with the engine at this time? if not: is it hard to change?

kumavis commented 9 years ago

Interesting question -- The game engine is not really suited for this, if you are just looking for rendering voxels there is more freedom. This isn't exactly straightforward but take a look at this: https://github.com/mikolalysenko/voxel-mipmap-demo/blob/master/lib/createMesh.js

ctzurcanu commented 9 years ago

Thank you. Rendering is the main intent. But it would not hurt to have the whole engine able to render cuboids..

kumavis commented 9 years ago

it would be a significant change as the block shape is assumed in a range of systems like physics, position/distance calculation, etc

kumavis commented 9 years ago

@mikolalysenko do we have a generic voxel renderer for stackgl?

ctzurcanu commented 9 years ago

@kumavis I am surprised that such variable has not been abstracted out into some kind of general settings :( yet..

mikolalysenko commented 9 years ago

@kumavis not anything usable out of the box, but you can probably patch up ao-mesher/ao-shader for this purpose. Going forward it would probably be better to move the shader bits into separate modules and make them directly requirable in stackgl. If anyone is interested in taking on this project I can offer some help.

ctzurcanu commented 9 years ago

how about if I do not need a texture map for those cuboids? (at least for a first version) I would love to have it with just a plain color with high transparency and no shade. (maybe transparency on voxels also has issues.. I will check on voxel-glass proj)

mikolalysenko commented 9 years ago

Another option is you can check out the surface-nets module, which extracts isosurfaces from volumes in any dimension:

https://github.com/mikolalysenko/surface-nets

kumavis commented 9 years ago

@ctzurcanu ah, this is the old mesher -- built for use with Three.js https://github.com/maxogden/voxel-mesh

kumavis commented 9 years ago

@ctzurcanu the status of the voxel.js project is that we were rewriting the scene-graph/rendering system and then got stuck b/c interest/free-time fizzled.

ctzurcanu commented 9 years ago

yes.. I can understand that the scene graph is more of a general concern. Let leave this issue open and we get to solve it when there is time for it. I may return to look into it myself if it becomes a nuisance. For the moment, I have more important blockers on my plate too.

kumavis commented 9 years ago

Sorry I think I'll label this as wontfix, I think it is a fringe concern for a project with an unclear survival status.

Though I encourage you to open up this issue on a general voxel mesh generator such as https://github.com/mikolalysenko/ao-mesher

ctzurcanu commented 9 years ago

Ups. I was not aware that is the only place that needs a change for this to work. Thank you for clarification.