It is currently Sat Aug 22, 2020 4:15 am


All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 8:47 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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...


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 9:27 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 9:39 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 9:50 pm 

Joined: Tue Jul 13, 2010 8:02 am
Posts: 5
Location: Germany, Kiel
wow, this looks promising :) i hope to find some time this week to test it with python.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 10:11 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
Got my rendering working :ugeek:
Image


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 11:11 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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 :-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 11:15 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
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


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 11:30 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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).


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 11:33 pm 

Joined: Sat Jan 15, 2011 3:49 pm
Posts: 38
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox language bindings
PostPosted: Sun Jan 16, 2011 11:46 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net