[Ves] Rotating 3D Model On a Single Axis Alone

shamsudheen shamsutk87 at gmail.com
Sun Feb 17 12:55:54 EST 2013


Thanks again for your quick and effective reply.

Importing #include <vtkTransform.h> in my VES project giving an error as vtkCommonTransformsModule.h not found in vtkTransform.h.

There is no VES classes returning vtkTransform pointer to me.

Could you please explain little-bit.


Note:

Actually I have done the single access rotation in X axis without effecting/reseting the Y-Axis.

I have just modified the currentTranslation.x, currentTranslation.y with my own logic in the below method/guesture and it worked fine

 handleSingleTouchPanGesture  self->renderer.app->handleSingleTouchPanGesture(currentTranslation.x, currentTranslation.y);

However Im looking for the Communication with VES and VTK (iOS and Windows).

My plan is to rotate a 3D model in widows pc while iOS app rotate the same 3D model in iPad.

So Im unable to use currentTranslation.x, currentTranslation.y in VTK (windows)

The only way to get the rotation angle.

So I have looked for another method vesActor->setRotation(vector);. However it resetting my Y axis previous rotation state while rotating X-axis.


Note: have just used   bool loadDataset(const std::string& filename); method to load my 3D file.this is a vesKiwiViewerApp.h class method.

 
Thanks.

On Feb 17, 2013, at 12:29 AM, Pat Marion wrote:

> I would use a vtkTransform.  It has the api you describe.
> 
> http://www.vtk.org/doc/nightly/html/classvtkTransform.html
> 
> 
> Pat
> 
> On Sun, Feb 17, 2013 at 9:47 AM, shamsudheen <shamsutk87 at gmail.com> wrote:
> 
> Hi All,
> 
> Im using vesKiwiViewerApp in my iOS application.
> 
> In my code, Im trying to rotate my 3D model manually using the below code
> 
>               vesVector4f rot ;
>         
>        	rot[0] = 1;
> 	rot[0] = 0;
> 	rot[0] = 0;       
>        
>         rot[3] = 90 * (M_PI/180.0);
> 
>   
>         vesKiwiPolyDataRepresentation* polyDataRepresentation =  self->renderer.app->getKiwiPolyDataRepresentation(0);
>         
>         vesSharedPtr<vesActor> vesActor = polyDataRepresentation->actor();
>       
>         vesVector3f center = vesActor->center();
>                
>         vesActor->setRotation(vector);
> 
>        [self scheduleRender];
> 
> 
> This would rotate my model on a particular direction.However when I change the axis ,the old rotated position is lost . Example code is given  below 
> 
>        	rot[0] = 0;
> 	rot[0] = 1;
> 	rot[0] = 0;       
>        
>         rot[3] = 90 * (M_PI/180.0);
> 
> I cannot find any methods which I can use to rotate the object on a single axis alone like  vesActor->rotateX(90); or  vesActor->rotateY(90) or  vesActor->rotateZ(90)
> 
> Are there any similar methods available in VES/Kiwi ?
> 
>  Any help on this is appreciated
> 
> Thanks .
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130217/167d25d6/attachment-0001.html>


More information about the Ves mailing list