[vtkusers] stereo problems
Clinton Stimpson
clinton at elemtech.com
Thu Jan 20 17:08:59 EST 2005
class LinkCameraCommand : public vtkCommand
{
public:
vtkTypeMacro(LinkCameraCommand, vtkCommand)
static LinkCameraCommand* New() { return new LinkCameraCommand; }
void SetCamera(vtkCamera* cam)
{
mTargetCamera = cam;
}
protected:
void Execute(vtkObject*,long unsigned int,void*);
vtkCamera* mTargetCamera;
};
void LinkCameraCommand::Execute(vtkObject* source_camera,long unsigned
int, void*)
{
vtkCamera *p_source_camera=(vtkCamera*)source_camera;
mTargetCamera->SetPosition(p_source_camera->GetPosition());
mTargetCamera->SetFocalPoint(p_source_camera->GetFocalPoint());
mTargetCamera->SetViewUp(p_source_camera->GetViewUp());
mTargetCamera->SetClippingRange(p_source_camera->GetClippingRange());
mTargetCamera->SetParallelScale(p_source_camera->GetParallelScale());
mTargetCamera->ComputeViewPlaneNormal();
}
Then in your code do something like this...
LinkCameraCommand* link_cam = LinkCameraCommand::New();
link_cam->SetCamera(mRightOverlayRenderer->GetActiveCamera());
mRightRenderer->GetActiveCamera()->AddObserver(vtkCommand::ModifiedEvent,
link_cam, 0);
link_cam->Delete();
Then if you interact with one camera, the other will follow.
Clint
------------------------------
Message: 10
Date: Thu, 20 Jan 2005 17:00:27 -0500
From: Sungeun Kim <sungeun at ecn.purdue.edu>
Subject: [vtkusers] stereo problems
To: vtkusers at vtk.org
Message-ID: <41F029FB.1010409 at ecn.purdue.edu>
Content-Type: text/plain; charset=us-ascii
Hi,
I am trying to render two volume datasets in one render window and
interact two volumes simutaneously.
While doing this, I have two problems, which are related to stereoscopic
display.
The first problem is the reversion of stereo pairs for
vtkVolumeRayCastMapper. I saw that many people mentioned this problem
before.
Probably, the negative eye separation value might be one possible
solution to some people, but in my case, I have to render two volumes
with some polygonal objects. So, I cannot use the negative eye
separation value.
Is there anybody who know whether this problem has been fixed or when it
will be fixed?
The second problem is related to using one camera for two renderers. I
need to rotate two volumes in the same direction at the same time.
So, I used only one camera for two volumes. However, in this situation,
if I enable the stereo display, each volume shows only one image of
either eye. If I use two separate cameras for two volumes, this problem
disappears, but I cannot control two volumes simultaneously.
Is there any suggestion about this problem?
Thank you in advance.
Sungeun Kim.
------------------------------
More information about the vtkusers
mailing list