Commit 34760cdb authored by schultezub's avatar schultezub
Browse files

implemented early support vor camera-in-volume in EEPGenerator

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@279 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 9872743e
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "tgt/logmanager.h" #include "tgt/logmanager.h"
#include "tgt/buffer.h" #include "tgt/buffer.h"
#include "tgt/vertexarrayobject.h" #include "tgt/vertexarrayobject.h"
#include "tgt/vertex.h" #include "tgt/vector.h"
namespace TUMVis { namespace TUMVis {
......
...@@ -111,6 +111,7 @@ namespace TUMVis { ...@@ -111,6 +111,7 @@ namespace TUMVis {
/** /**
* Clips this FaceGeometry against an aribtrary clip plane. * Clips this FaceGeometry against an aribtrary clip plane.
* The clipped FaceGeometry is returned. * The clipped FaceGeometry is returned.
* \note Because of using only float internally, the precision is somewhat poor.
* \param p Point on clip plane * \param p Point on clip plane
* \param normal Clip plane normal * \param normal Clip plane normal
* \param epsilon Clipping precision * \param epsilon Clipping precision
......
...@@ -76,12 +76,14 @@ namespace TUMVis { ...@@ -76,12 +76,14 @@ namespace TUMVis {
if (img != 0 && proxyGeometry != 0) { if (img != 0 && proxyGeometry != 0) {
if (img->getDimensionality() == 3) { if (img->getDimensionality() == 3) {
// TODO: implement some kind of cool proxy geometry supporting clipping (camera in volume)...
tgt::Bounds volumeExtent = img->getWorldBounds(); tgt::Bounds volumeExtent = img->getWorldBounds();
tgt::Bounds textureBounds(tgt::vec3(0.f), tgt::vec3(1.f)); tgt::Bounds textureBounds(tgt::vec3(0.f), tgt::vec3(1.f));
//MeshGeometry clipped = proxyGeometry->clipAgainstPlane(100, tgt::vec3(1.f), true); // clip proxy geometry against near-plane to support camera in volume
// FIXME: In some cases, the near plane is not rendered correctly...
float nearPlaneDistToOrigin = tgt::dot(_camera.getValue().getPosition(), -_camera.getValue().getLook()) - _camera.getValue().getNearDist() - .001f;
MeshGeometry clipped = proxyGeometry->clipAgainstPlane(nearPlaneDistToOrigin, -_camera.getValue().getLook(), true, 0.02f);
// set modelview and projection matrices // set modelview and projection matrices
glPushAttrib(GL_ALL_ATTRIB_BITS); glPushAttrib(GL_ALL_ATTRIB_BITS);
...@@ -100,7 +102,7 @@ namespace TUMVis { ...@@ -100,7 +102,7 @@ namespace TUMVis {
glClearDepth(1.0f); glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glCullFace(GL_BACK); glCullFace(GL_BACK);
proxyGeometry->render(); clipped.render();
entrypoints->deactivate(); entrypoints->deactivate();
...@@ -112,7 +114,7 @@ namespace TUMVis { ...@@ -112,7 +114,7 @@ namespace TUMVis {
glClearDepth(0.0f); glClearDepth(0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glCullFace(GL_FRONT); glCullFace(GL_FRONT);
proxyGeometry->render(); clipped.render();
exitpoints->deactivate(); exitpoints->deactivate();
......
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