Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

PolyVox language bindings
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=118
Page 4 of 6

Author:  David Williams [ Sun Jan 16, 2011 8:47 pm ]
Post subject:  Re: PolyVox language bindings

I've commited the fix for the POLYVOXCORE_API issue, but might look for another way to do that in the future as it's a little ugly.

I've now generated a folder full of .cs file and am running:

csc /target:library *.cs

which gives no problems and generates Density8.dll. Even when I deliberatly insert C++ compile errors into the PolyVox code. Are you running something different? I don't know much about C# so it's probably a simple mistake...

Edit: Ah, right, I must have to compile 'PolyVoxCore_wrap.cxx'. How do I do that so it can be used with the .cs files? I assume you are working from the command line, can you tell me what commands you are entering? I guess they should be added to the batch file. You know more about it than I do at this point...

Author:  ape [ Sun Jan 16, 2011 9:27 pm ]
Post subject:  Re: PolyVox language bindings

All I had to do was add PolyVoxCore_wrap.cxx to the visual studio project that cmake generated for polyvoxcore, then I compiled it normally to a dll.

Author:  David Williams [ Sun Jan 16, 2011 9:39 pm ]
Post subject:  Re: PolyVox language bindings

Hmmm.... I see. So if building everything from scratch you would run SWIG first, before you build the main .dll. I think the workflow was different with Python, and I want to still allow the main library to be built for C++ even if SWIG (and hence the generated .cpp) is not present on the users machine. But that's ok, it's just a bit of fiddling around with the build system.

Anyway, I commented out those problematic functions and they'll be removed in the future if no one complains. They were a bit dubious anyway.

Thanks again for your help, and do let me know if you need to change anything else.

Author:  Loschi [ Sun Jan 16, 2011 9:50 pm ]
Post subject:  Re: PolyVox language bindings

wow, this looks promising :) i hope to find some time this week to test it with python.

Author:  ape [ Sun Jan 16, 2011 10:11 pm ]
Post subject:  Re: PolyVox language bindings

Got my rendering working :ugeek:
Image

Author:  David Williams [ Sun Jan 16, 2011 11:11 pm ]
Post subject:  Re: PolyVox language bindings

Loschi wrote:
wow, this looks promising :) i hope to find some time this week to test it with python.

Yep, it seems these bindings are really starting to take shape. Let us know how it works out with Python and I'll try to give any more help I can...

ape wrote:
Got my rendering working :ugeek:

Great! That's very... psychedelic :-)

Author:  ape [ Sun Jan 16, 2011 11:15 pm ]
Post subject:  Re: PolyVox language bindings

Yeah, just using random vertex colors to test :P. I just figured out that the indices needed reversing, it was drawing everything backwards in that screenshot, haha. Here's one with a bunch of holes.
http://dl.dropbox.com/u/6281166/voxelxna4.jpg

Author:  David Williams [ Sun Jan 16, 2011 11:30 pm ]
Post subject:  Re: PolyVox language bindings

You mean the triangle winding order is wrong? You can probably set this in XNA. I think PolyVox uses whatever OpenGL defaults to (which I think is counter clockwise).

Author:  ape [ Sun Jan 16, 2011 11:33 pm ]
Post subject:  Re: PolyVox language bindings

Yeah it uses right handed winding/clockwise. Kind of weird. Apparently they used to have functions for lefthanded winding but it was removed a while back. If flipping the indices after generation is too slow I can always go in and change polyvox to support both, I guess.

Author:  David Williams [ Sun Jan 16, 2011 11:46 pm ]
Post subject:  Re: PolyVox language bindings

The lefthanded/righthanded issue is seperate from the clockwise/counterclockwise issue (I think I'm talking sense here). I think you just need to set the right CullMode, something like:

Code:
RasterizerState stat = newRasterizerState();
stat.CullMode = CullMode.CullClockwiseFace; //Or the other way

Page 4 of 6 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/