Commit e4800789 authored by Michele Bosi's avatar Michele Bosi

Updated App_Vivid test

parent 1a11fb59
......@@ -54,6 +54,8 @@
// #define MODEL_FILENAME "/tmp/bunny.ply"
// #define MODEL_FILENAME "/tmp/niftk.vlb"
#define MODEL_FILENAME "/tmp/rsg-liver.vlb"
// #define MODEL_FILENAME "/tmp/MRV.stl"
using namespace vl;
......@@ -92,7 +94,8 @@ public:
loadModel(files);
#endif
mBackgroundImages[0] = loadImage( "/tmp/rsg-liver.png" );
// mBackgroundImages[0] = loadImage( "/tmp/rsg-liver.png" );
mBackgroundImages[0] = loadImage( "/tmp/liver.jpg" );
mBackgroundImages[1] = loadImage( "/images/sun1.png" );
mBackgroundImages[2] = loadImage( "/images/sun2.png" );
mBackgroundImages[3] = loadImage( "/images/sun3.png" );
......@@ -256,7 +259,7 @@ public:
// Stencil Test: liver geometry
if ( act->objectName() == "surface:liver" ) {
// mVividRendering->setStencilGeommetry( geom );
// mVividRendering->stencilActors().push_back( act );
// mVividRendering->setStencilEnabled( true );
// continue;
mLiverActor = act;
......@@ -383,6 +386,7 @@ public:
mVividRendering->sceneManager()->computeBounds();
mVividRendering->sceneManager()->tree()->computeAABB();
#if 1
// make spherical stencil
ref< Geometry > icosphere = makeIcosphere( mVividRendering->sceneManager()->tree()->aabb().center() + vec3( -50, 0, 25 ), 100, 3 );
// ref< Geometry > stencil = makeIcosphere( vec3( 0, 0, 0 ), 100, 3 );
......@@ -399,7 +403,9 @@ public:
mVividRendering->stencilActors().push_back( stencil_act2 );
tr1->setLocalAndWorldMatrix( vl::mat4::getTranslation(-50,0,0) );
tr2->setLocalAndWorldMatrix( vl::mat4::getTranslation(+50,0,0) );
#endif
#if 0
// make points
{
ref< Geometry > points = makeIcosphere( mVividRendering->sceneManager()->tree()->aabb().center() + vec3( -50, 0, 25 ), 100, 3 );
......@@ -425,6 +431,8 @@ public:
fx->shader()->gocHint()->setPointSmoothHint( vl::HM_FASTEST );
#endif
}
#endif
#if 0
// fog
ref< Fog > fog = new Fog();
......@@ -451,7 +459,7 @@ public:
#endif
// Volume
#if 0
vec3 volume_box_center = mVividRendering->sceneManager()->tree()->aabb().center();
AABB volume_box;
volume_box.setMinCorner( volume_box_center - vec3(100,50,50) );
......@@ -470,7 +478,9 @@ public:
Actor* vol_box = mVividRendering->sceneManager()->tree()->addActor( box_outline.get(), fx_box.get(), mVividRendering->vividVolume()->volumeTransform() );
vol_box->setEnableMask( vl::VividRenderer::DefaultEnableMask );
vol_box->setObjectName( "Volume Box" );
#endif
#if 0
// texture mapped quad
ref<Image> vl_img = loadImage( "/tmp/liver/VL-Stencil.png" );
ref<Geometry> quad = vl::makeGrid( volume_box.center(), volume_box.width(), volume_box.depth(), 10, 10, true );
......@@ -489,7 +499,7 @@ public:
ref<vl::Texture> texture = fx->shader()->getTextureSampler( vl::VividRendering::UserTexture )->texture();
// Recreate new texture (TexParameter is not reset so we can keep the current defaults)
texture->createTexture2D( vl_img.get(), vl::TF_UNKNOWN, false, false );
#endif
adjustScene();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment