<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Well, <br>
<br>
it looks like the described bug vtkInteractorStyleTerrain did not
attract any developer.<br>
I might give up using the vtkInteractorStyleTerrain and replace it
with vtkInteractorStyleTrackball as this problem does not occur in
this one, though the behaviour of vtkInteractorStyleTerrain much
better fits my needs.<br>
<br>
Any idea, maybe from the vtk team ?<br>
JD<br>
<br>
Le 03/04/2011 11:01, pof a écrit :
<blockquote cite="mid:4D983782.8040700@gmail.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Dear vtker's,<br>
No answer yet, so does it means that I'm now the only one having
this problem ?<br>
Herebelow is a small example program that illustrate this
incompatibility between vtkInteractorStyleTerrain and
vtkAxesActor/vtkOrientationMarkerWidget.<br>
Any idea/comment ?<br>
<br>
////////////////<br>
#include "vtkCylinderSource.h"<br>
#include "vtkPolyDataMapper.h"<br>
#include "vtkActor.h"<br>
#include "vtkRenderer.h"<br>
#include "vtkRenderWindow.h"<br>
#include "vtkRenderWindowInteractor.h"<br>
#include "vtkProperty.h"<br>
#include "vtkCamera.h"<br>
#include "vtkAxesActor.h"<br>
#include "vtkOrientationMarkerWidget.h"<br>
#include "vtkInteractorStyleTerrain.h"<br>
<br>
int main()<br>
{<br>
// Creates a polygonal cylinder model with eight
circumferential facets.<br>
vtkCylinderSource *cylinder = vtkCylinderSource::New();<br>
cylinder->SetResolution(20);<br>
cylinder->SetCenter(0,0,0.);<br>
cylinder->SetRadius(10.);<br>
cylinder->SetHeight(20.);<br>
vtkPolyDataMapper *cylinderMapper = vtkPolyDataMapper::New();<br>
cylinderMapper->SetInputConnection(cylinder->GetOutputPort());<br>
vtkActor *cylinderActor = vtkActor::New();<br>
cylinderActor->SetMapper(cylinderMapper);<br>
cylinderActor->GetProperty()->SetColor(1.0000, 0.3882,
0.2784);<br>
<br>
vtkPolyDataMapper *MeshMapper = vtkPolyDataMapper::New();<br>
vtkActor *MeshActor = vtkActor::New();<br>
MeshMapper->SetInputConnection(cylinder->GetOutputPort());<br>
MeshActor->SetMapper(MeshMapper);<br>
(MeshActor->GetProperty())->SetInterpolationToFlat();<br>
(MeshActor->GetProperty())->BackfaceCullingOff();<br>
(MeshActor->GetProperty())->EdgeVisibilityOn();<br>
(MeshActor->GetProperty())->SetLineWidth(2);<br>
(MeshActor->GetProperty())->SetColor(0.,0.6,0.8);<br>
(MeshActor->GetProperty())->SetRepresentationToWireframe();<br>
<br>
// Create the graphics structure.<br>
vtkRenderer *ren = vtkRenderer::New();<br>
vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
<br>
renWin->AddRenderer(ren);<br>
renWin->SetSize(600, 600);<br>
<br>
vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();<br>
iren->SetRenderWindow(renWin);<br>
<br>
// Add the actors to the renderer, set the background and size<br>
ren->AddActor(cylinderActor);<br>
ren->AddActor(MeshActor);<br>
ren->SetBackground(0.1, 0.2, 0.4);<br>
<br>
// We'll zoom in a little by accessing the camera and invoking
a "Zoom"<br>
// method on it.<br>
ren->ResetCamera();<br>
ren->GetActiveCamera()->Zoom(1.0);<br>
renWin->Render();<br>
<br>
vtkInteractorStyleTerrain *styleTerrain =
vtkInteractorStyleTerrain::New();<br>
iren->SetInteractorStyle(styleTerrain);<br>
<br>
vtkAxesActor *Axes = vtkAxesActor::New();<br>
Axes->SetShaftTypeToCylinder();<br>
Axes->SetXAxisLabelText( "X" );<br>
Axes->SetYAxisLabelText( "Y" );<br>
Axes->SetZAxisLabelText( "Z" );<br>
<br>
vtkOrientationMarkerWidget *AxesWidget =
vtkOrientationMarkerWidget::New();<br>
AxesWidget->SetOutlineColor(0,0,0);<br>
AxesWidget->SetOrientationMarker(Axes);<br>
AxesWidget->SetInteractor(iren);<br>
AxesWidget->SetViewport( 0.0, 0.0, 0.2, 0.2 );<br>
AxesWidget->SetEnabled(1);<br>
AxesWidget->InteractiveOn();<br>
<br>
// This starts the event loop and as a side effect causes an
initial render.<br>
iren->Start();<br>
<br>
// Exiting from here, we have to delete all the instances that<br>
// have been created.<br>
cylinder->Delete();<br>
cylinderMapper->Delete();<br>
cylinderActor->Delete();<br>
MeshMapper->Delete();<br>
MeshActor->Delete();<br>
ren->Delete();<br>
renWin->Delete();<br>
iren->Delete();<br>
<br>
return 0;<br>
}<br>
<br>
<br>
<br>
Le 24/03/2011 11:26, Pof a écrit :
<blockquote
cite="mid:AANLkTi=p9ye934VdwKYKUnZMFJYiPJs=pp9aeQRhckpz@mail.gmail.com"
type="cite">
<div>Answering to myself, just to mention that similar problem
has already been reported in the mailing list, but I could not
find any answer.</div>
<div> </div>
<div>So does this means the only solution is not to use
vtkInteractorStyleTerrain with vtkOrientationMarkerWidget??</div>
<div> </div>
<div>Thanks for any tip/advice</div>
<div>JD<br>
<br>
</div>
<div class="gmail_quote">2011/3/22 Pof <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:jd379252@gmail.com"
target="_blank">jd379252@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="padding-left: 1ex;
margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204,
204, 204);">
<p>Hi all,</p>
<p>when the vtkInteractorStyleTerrain is used with
vtkAxesActor/vtkOrientationMarkerWidget:<br>
- the following error message is obtained "Resetting
view-up since view plane normal is parallel"<br>
- the orientation of the vtkAxesActor gets wrong when
viewing along the z-axis.</p>
<p>Is there any way to correct this behaviour (apart from
not displaying the warning message)?</p>
<p>Thanks</p>
</blockquote>
</div>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>