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

Aashish Chaudhary aashish.chaudhary at kitware.com
Mon Feb 18 09:52:27 EST 2013


Shamsudheen,

This is currently a shortcoming in VES actor API. Actually I wanted to
fix this for some time and may be next week I can work on it some. If
you would like to make changes to VES actor API, and submit a patch
then let me know.

Thanks,


On Sun, Feb 17, 2013 at 9:44 PM, Pat Marion <pat.marion at kitware.com> wrote:
>
> The VES library does not use VTK, so you will not find a vtkTransform pointer in VES.  But the kiwi library does.  See vesKiwiDataRepresentation::setTransformOnActor().
>
> Pat
>
>
> On Mon, Feb 18, 2013 at 3:55 AM, shamsudheen <shamsutk87 at gmail.com> wrote:
>>
>> 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 .
>>>
>>
>>
>



--
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com



More information about the Ves mailing list