alinakipoglu Posted February 26, 2013 Share Posted February 26, 2013 Im trying to generate volumes from geometry inputs. Is there a way to achieve this goal using HDK?. I tried using GU_SDF and i posted my process on separate topic. The docs for it lacks any walk through and i got stuck. Is there any one can point me to right direction? Any suggestions? Quote Link to comment Share on other sites More sharing options...
alinakipoglu Posted February 27, 2013 Author Share Posted February 27, 2013 Still nobody knows how to make this? Quote Link to comment Share on other sites More sharing options...
edward Posted February 28, 2013 Share Posted February 28, 2013 Are you trying to output a fog volume or SDF? Offhand, you should be able to double-check your GU_SDFParameters by using an IsoOffset SOP to confirm that the volume generated is what you expect. It should be fairly obvious as to which parameters on that node map to the ones in GU_SDFParameters. The HDK is a deep library and quite frankly, (at least) I'm reluctant to help anyone out unless they've shown that they're competent in programming and C++. Looking at your other post, it looks like you have the right idea in the use of GU_SDF but I'm unfamiliar with how to write proper mantra procedurals. Quote Link to comment Share on other sites More sharing options...
alinakipoglu Posted February 28, 2013 Author Share Posted February 28, 2013 (edited) Hi Edward Thank you very much. I used IsoOffset values in GU_SDF. I wonder why this is happening. Im getting only a small volume cube rendered even with a wrong bbox (fair to smaller then original input). Im fairly comfortable with cpp and if you tell me how to use SDF in a proper way i hope i can fix this problem. Why sesi didn't provides any example for this :/ Edited February 28, 2013 by alinakipoglu Quote Link to comment Share on other sites More sharing options...
edward Posted February 28, 2013 Share Posted February 28, 2013 Sorry, I don't understand what you are saying. Are you getting the expected volume when using the IsoOffset SOP? If yes, then you should try to replicate this in your own custom SOP and verify that you can reproduce what the IsoOffset SOP does. Once you get this to work, then you will have your answer (on how to generate volumes from meshes in the HDK). Quote Link to comment Share on other sites More sharing options...
alinakipoglu Posted February 28, 2013 Author Share Posted February 28, 2013 (edited) Im not getting expected results. Its 1. smaller, 2. i get only a voxel box which is not the input i gave for GU_SDF. You can see it here Edited February 28, 2013 by alinakipoglu Quote Link to comment Share on other sites More sharing options...
alinakipoglu Posted February 28, 2013 Author Share Posted February 28, 2013 Ok! Got it. You can find procedure below. It will convert meshes into fog volumes. OP_ERROR SOPNODE::cookMySop( OP_Context &context_ ){ if( lockInputs( context_ ) >= UT_ERROR_ABORT ) { return error(); } duplicateSource( 0, context_ ); UT_BoundingBox bbox; GU_SDFParms sdfParms; GU_SDF sdf; gdp->getBBox( &bbox ); sdfParms.setMode( GU_SDFParms::RAY_INTERSECT ); sdfParms.setDivisions( 100, 100, 100 ); sdfParms.setBBox( bbox ); sdfParms.setLaserScan( true ); sdfParms.setFixSigns( true ); sdfParms.setSweepCount( 3 ); sdfParms.setSweepThreshold( 2.0f ); sdf.build( gdp, sdfParms ); gdp->clearAndDestroy(); GU_PrimVolume *volumePtr = (GU_PrimVolume *)GU_PrimVolume::build( gdp ); UT_VoxelArrayIteratorF vit; vit.setArray( sdf.getFunction() ); for( vit.rewind(); !vit.atEnd(); vit.advance() ) { vit.setValue( vit.getValue() <= 0.0f ? 1.0f : 0.0f ); } volumePtr->setVoxels( sdf.getFunction() ); unlockInputs(); return error();}[/CODE] Quote Link to comment Share on other sites More sharing options...
edward Posted March 1, 2013 Share Posted March 1, 2013 Ok! Got it. You can find procedure below. It will convert meshes into fog volumes. Er, I don't think you ever quite mentioned that you wanted a fog volume? SDF stands for Signed Distance Field, so why would it ever generate a fog volume? 1 Quote Link to comment Share on other sites More sharing options...
alinakipoglu Posted March 1, 2013 Author Share Posted March 1, 2013 (edited) Edward, I know what it is. To get Fog volume i needed that first. This is why i posted both.. I know my explanation text has some issues. Maybe its not clear. Im doing my best. Actually your contribution to this post again not for helping either! Anyway thank you for your comments. Edited March 1, 2013 by alinakipoglu Quote Link to comment Share on other sites More sharing options...
magneto Posted March 1, 2013 Share Posted March 1, 2013 Actually your contribution to this post again not for helping either! Are you serious? Edward's one of the developers and he's trying to help you out of his own charity. Yet you sound like you are entitled to getting your problem solved. You should be glad he even bothered to reply IMO. Quote Link to comment Share on other sites More sharing options...
alinakipoglu Posted March 2, 2013 Author Share Posted March 2, 2013 As i said, im thankful for his comments. My aim is not disrespect or blame anyone here, but im not stating that without a reason. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.