<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>I wonder if anybody could give me any hint? I try to make a subclass of vtkCamera (say tmpCamera), but by using tmpCamera, no actor shows up. but if I just replace "tmpCamera *camera = new tmpCamera;" with "vtkCamera *camera = vtkCamera::New();" , the actor shows up. Here is the code:</DIV>
<DIV> </DIV>
<DIV>#include "vtkRenderer.h"<BR>#include "vtkRenderWindow.h"<BR>#include "vtkRenderWindowInteractor.h"<BR>#include "vtkPolyDataMapper.h"<BR>#include "vtkActor.h"<BR>#include "vtkProperty.h"<BR>#include "vtkCamera.h"<BR>#include "vtkInteractorStyleTrackballCamera.h"<BR>#include "vtkCubeSource.h"</DIV>
<DIV> </DIV>
<DIV><BR>class tmpCamera :public vtkCamera{};</DIV>
<DIV> </DIV>
<DIV>int main_rotate_about_picked_point( int argc, char *argv[] )<BR>{<BR> vtkCubeSource *cube = vtkCubeSource::New();<BR> vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();<BR> mapper->SetInput(cube->GetOutput());<BR> mapper->ScalarVisibilityOff();</DIV>
<DIV> </DIV>
<DIV> vtkActor* actor = vtkActor::New();<BR> actor->SetMapper(mapper);<BR> actor->SetPosition(0.0,0.0,-3.0);<BR> actor->GetProperty()->SetColor(0.0,1.0,0.0);</DIV>
<DIV> </DIV>
<DIV>vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New();<BR> <BR> vtkRenderer *ren = vtkRenderer::New();<BR> tmpCamera* camera = new tmpCamera();</DIV>
<DIV> ren->SetActiveCamera(camera);<BR> ren->AddActor(actor);</DIV>
<DIV> </DIV>
<DIV>vtkRenderWindow *renwin = vtkRenderWindow::New();<BR> renwin->AddRenderer(ren);<BR> <BR> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<BR> iren->SetRenderWindow(renwin);<BR> iren->SetInteractorStyle(style);<BR> <BR> renwin->SetSize(600,600);<BR> renwin->Render();<BR> iren->Initialize();<BR> iren->Start();<BR> <BR> return 0;</DIV>
<DIV>}<BR> </DIV>
<DIV>What did I do wrong? thanks a lot</DIV>
<DIV> </DIV>
<DIV>Yanbing</DIV></BODY></HTML>
______________________________________________________________ <BR>
<BR>
Reputation Resources Results <BR>
<BR>
http://www.rwdi.com <BR>
<BR>
______________________________________________________________ <BR>
<BR>
This communication is intended for the sole use of the party to whom it <BR>
is addressed and may contain information that is privileged and/or <BR>
confidential. Any other distribution, copying or disclosure is strictly<BR>
prohibited. If you have received this e-mail in error, please notify us<BR>
immediately by telephone (1-519-823-1311) and delete the message without <BR>
retaining any hard or electronic copies of same. <BR>
<BR>
RWDI scans outgoing emails for viruses, but makes no warranty as to their<BR>
absence in this email or attachments.<BR>
</BODY></HTML>