[vtkusers] How to Move y and Z axis when x axis is constant?

Arindam arindam at triassicsolutions.com
Wed Apr 10 09:41:37 EDT 2013


Hi,

I have a 3D axes. I want to make my x axis as constant.Means X axis 
should not move.But i need to move Y and Z axis.Menas it will be like 
that i need to move a 3D object based on x axis.This is my existing code.

             vtkCubeSource cubeSource = vtkCubeSource.New();
             //cubeSource.SetCenter(0.0, 0.0, 0.0);
             //cubeSource.SetRadius(0.5);

             //create a mapper
             vtkPolyDataMapper cubeMapper = vtkPolyDataMapper.New();
cubeMapper.SetInputConnection(cubeSource.GetOutputPort());

             // create an actor
             vtkActor cubeActor = vtkActor.New();
             cubeActor.SetMapper(cubeMapper);

             // a renderer and render window
             vtkRenderWindow renderWindow = 
renderWindowControl1.RenderWindow;
             vtkRenderer renderer = 
renderWindow.GetRenderers().GetFirstRenderer();
             renderer.SetBackground(0.2, 0.3, 0.4);

             // add the actors to the scene
             renderer.AddActor(cubeActor);

             vtkAxesActor axes = vtkAxesActor.New();
             // The axes are positioned with a user transform
             vtkTransform transform = vtkTransform.New();
             transform.Translate(0, 0.0, 0.0);
             axes.SetUserTransform(transform);
             axes.SetTotalLength(5, 5, 5);
             axes.SetAxisLabels(1);
             axes.SetTipType(1);

             renderer.AddActor(axes);
             renderWindow.Render();

-- 

Regards,
*ARINDAM SAHA
Software Engineer*
Triassic Solutions Pvt. Ltd.
(+91) 471 2700050 (Office)
9746145220 (Mobile)
<http://www.triassicsolutions.com>

Disclaimer: This e-mail contains confidential information intended 
solely for the intended recipient. If you are not the intended 
recipient, please notify the sender by e-mail and delete this email 
permanently from your records. Do not copy or distribute this e-mail and 
any such actions are unlawful. Except where this email is sent in the 
usual course of business, the views expressed in this email are those of 
the sender. Triassic Solutions Pvt. Ltd. accepts no responsibility for 
any indirect damage or loss suffered by reason of inaccuracy or 
incorrectness of the information in this email.
+ Please consider our environment before printing this e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130410/cdaa8f86/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aigicgcc.
Type: image/jpg
Size: 6447 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130410/cdaa8f86/attachment.jpg>


More information about the vtkusers mailing list