voxelTerrain - marching cubes, transvoxel - demo - vid - src

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

voxelTerrain - marching cubes, transvoxel - demo - vid - src

Post by qwertzui11 »

thread is depricated - checkout http://www.ogre3d.org/forums/viewtopic.php?f=11&t=77978

vid:
[youtube]7xTUvElNTj4[/youtube]

Feedback:
Any feedback would be great.

Have fun
Markus
Last edited by qwertzui11 on Fri Mar 28, 2014 12:38 pm, edited 3 times in total.

User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by PolyVox »

Very interesting! A number of people have requested that I implement the transvoxel algorithm into my own voxel terrain library (PolyVox). I may do this in the future, but I wonder how well the algorithm works if you want each voxel to have a material as well as a density value. It seems to me that this is a difficult problem to solve as there is no sensible way to determine which materials to use for the lower LODs. Have you considered adding multiple materials at all, or does the transvoxel algorithm provide a way to handle this?

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

if u already got multiple materials at ur voxel terrain, there wont be any problems with the transvoxel algo too.
But beside it was quite easy implementing the marching cubes algo, there's a lot of code online to find for marching cubes and dividing it in parts isn't that difficult. For rendering a simple octree is enough.
For Transvoxel there're quite no resources and rendering all the lods got hard work espeacilly because they get calculated totally async and parallel.

Markus

drwbns
Orc Shaman
Posts: 777
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 23

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by drwbns »

This looks awesome, I wanted to try to implement PolyVox for converting an Ogre::TerrainGroup to voxels to allow for editing but I'm failing at it. Do you have any tips on how to accomplish this? Nice work BTW!

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

It's not trivial, there'd be a lot of tips :D ; u should intensly read Eric Lengyel’s Dissertation @ http://www.terathon.com/voxels/
u may wanna study my method part3::calculateTransvoxel(...) in the class part3:
https://github.com/qwertzui11/voxel-Ter ... /part3.cpp

Or u may wanna buy a license of the c4 engine which has an implementation of Transvoxel too; at standard license u get the src too.
https://www.terathon.com/c4engine/order.php

Markus

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

whops u wrote PolyVox, not Transvoxel :D
I got no idea of the PolyVox lib and its ad- and disadvantages, or usage.

Markus

drwbns
Orc Shaman
Posts: 777
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 23

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by drwbns »

Were you going to put the rest of the source code in the repository?

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

i could; but it's just the convertion of the vector3 arrays of postions and normals and the array of triangles to a mesh.
call part3::hullVertices(), call part3::hullNormals() and part3::hullTriangles() für the geometry

Markus

GavinL
Gnoblar
Posts: 19
Joined: Fri Sep 09, 2011 11:32 pm

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by GavinL »

Are there some files missing in the repository? You seem to be including some header files that do not exist such as

blub/core/axisAlignedBox.hpp
blub/core/triangle.hpp
blub/core/hashMap.hpp
blub/core/mutex.hpp
blub/core/sharedPointer.hpp

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

I didn't add them because they are "special". In my Demo hashMap simply derives from QHash (Qt), mutex derives from boost::mutex, axisAlignbedBox derives from Ogre::AxisAlignedBoundingBox.
For Platform-, Renderer- and Engine-Independency I didn't add them. U may wanna replace these Classes with ur own.
However if u just wanna get it running or get stuck at implementation; I'll post the missing core files.

Have fun
markus

GavinL
Gnoblar
Posts: 19
Joined: Fri Sep 09, 2011 11:32 pm

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by GavinL »

If you could add those files, I would really appreciate it, I'd like to get it working so I can tinker with it.

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

i commited and pushed the missing core files. However they are full of dependencies, like Qt, Ogre3d, bullet or boost.

Have fun
Markus

GavinL
Gnoblar
Posts: 19
Joined: Fri Sep 09, 2011 11:32 pm

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by GavinL »

Thanks Markus!

Just a quick question. Was there any particular reason you choose to use the QT containers over the STL containers?

Also, I think you're still missing a few files: line.hpp, plane.hpp

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

u r welcome

For Qt there are only historical reasons why I use them. I really should replace them with stl/boost headers :roll: However I really like the QString class, everthing else is replaceable and maybe better.

Markus

drwbns
Orc Shaman
Posts: 777
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 23

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by drwbns »

Are you saying the missing files aren't needed? Or are you going to upload them also?

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

GavinL wrote:Also, I think you're still missing a few files: line.hpp, plane.hpp
added them.

Yes all used core files are now pushed to the repo too.

Have fun
Markus

weifeng021
Gnoblar
Posts: 4
Joined: Tue Dec 27, 2011 4:34 am

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by weifeng021 »

Thanks qwertzui11!
But there are also files missing. Such as

blub/core/file.hpp
blub/core/map.hpp
blub/core/sharedPointer.hpp
blub/graphic/material.hpp
blub/core/quadVector3.hpp

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

added too.

Markus

weifeng021
Gnoblar
Posts: 4
Joined: Tue Dec 27, 2011 4:34 am

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by weifeng021 »

qwertzui11 wrote:added too.

Markus
Also

blub/core/quaternion.hpp
blub/core/vector2.hpp


And don't you provide the whole project? You are appreciated.

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

added all core, graphic and physic classes. They are quite unclean.
DIDN'T add network, login, dbms, input and sound classes. There shouldn't be any deps to these classes.

Beside in physic is the bullet implementation of physics for the voxelTerrain.

Markus

weifeng021
Gnoblar
Posts: 4
Joined: Tue Dec 27, 2011 4:34 am

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by weifeng021 »

qwertzui11 wrote:added all core, graphic and physic classes. They are quite unclean.
DIDN'T add network, login, dbms, input and sound classes. There shouldn't be any deps to these classes.

Beside in physic is the bullet implementation of physics for the voxelTerrain.

Markus
Only one :

blub/gui/renderWindow.hpp


Thanks!

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

done

weifeng021
Gnoblar
Posts: 4
Joined: Tue Dec 27, 2011 4:34 am

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by weifeng021 »

qwertzui11 wrote:done
what is the entrance of the project? or this project does not execute ? Or it does not generate an application?

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

no it doesn't, as I said it's really "just" the lib for created a iso surface of some voxel data. Let's continue this support via PM ;)

Markus

qwertzui11
Halfling
Posts: 80
Joined: Wed May 14, 2008 10:44 am
Location: EU
x 22
Contact:

Re: voxelTerrain - marching cubes, transvoxel - demo - vid -

Post by qwertzui11 »

changed license to WTFPL because of http://www.ogre3d.org/forums/viewtopic.php?f=13&t=69449

Markus

Post Reply