[Ves] Getting Angle or XYZ Points of a Rendered 3D Object

Pat Marion pat.marion at kitware.com
Sun Jan 20 19:18:05 EST 2013


Yes, that's exactly right.  I find it is helpful to organize your code in a
derived, c++ app class.  Use objective-c just for the app's UI, use c++ for
the logic, since VES and VTK are c++ libraries.  You could add a public
method that returns a string,  std::string getViewDirectionLabel() and that
would return "Front View" or "Side View", etc.  The string label could be
computed on-the-fly from the camera view directory.  Then your objective-c
UI code can ask the app class for the view direction label.

Pat

On Mon, Jan 21, 2013 at 10:13 AM, SHAMSUDHEEN TK <shamsutk87 at gmail.com>wrote:

> okay,thanks again.
>
> Do you mean to create a new class which inherits the vesKiwiViewerApp.h
>  and retrieve the vesCamera and vesVector3f objects ?
>
> Sorry , if the question does not make any sense.
>
>
>
> On Sun, Jan 20, 2013 at 5:59 PM, Pat Marion <pat.marion at kitware.com>wrote:
>
>> Typo in previous email... I meant camera view direction.
>>
>> Pat
>>
>>
>> On Mon, Jan 21, 2013 at 9:58 AM, Pat Marion <pat.marion at kitware.com>wrote:
>>
>>> Please re-read my previous email.  I think my suggestion to get the
>>> camera view directory will be helpful.
>>>
>>> Pat
>>>
>>>
>>> On Mon, Jan 21, 2013 at 7:09 AM, SHAMSUDHEEN TK <shamsutk87 at gmail.com>wrote:
>>>
>>>> oh.. okay thank you very much for the answer.
>>>>
>>>> Let me clarify my question in detail.
>>>>
>>>> Let take an example, I have a TeaPort.. Each portions of the TeaPort
>>>> representing separate views.. let say front-view , bottom-view, side-view ,
>>>> front -right-view, front-left-view etc...
>>>>
>>>> My aim is to display the corresponding views name in a Label while user
>>>> rotating the 3D TeaPort object.
>>>>
>>>> So my logic should be like this, first i will identify all the angles
>>>> or xyz points which is corresponding to the each separate views. example:
>>>> 30-40 angle will be  front-view, 60-70 will be front -right-view such on.
>>>>
>>>> When the current 3D object angles meet 30-40  degree while rotating ,
>>>> we can easily know the TeaPort view is front-view.When angles meet 60-70
>>>> ,it should be front -right-view.
>>>>
>>>> I hope you cleared my concept,
>>>>
>>>> Any good suggestions from your side to help me..
>>>>
>>>> Thanks again for your answer.
>>>>
>>>>
>>>>
>>>> On Sun, Jan 20, 2013 at 5:41 AM, Pat Marion <pat.marion at kitware.com>wrote:
>>>>
>>>>> Hi Shamsudheen,
>>>>>
>>>>> I'm not sure exactly what you're trying to get with angle, do you mean
>>>>> the camera angle?  When you use gestures to rotate, you are actually moving
>>>>> the camera, not the object.  I assume you are using vesKiwiViewerApp in
>>>>> your application?  This class, in the VES master branch, makes access to
>>>>> the renderer and camera protected function calls, so you can derive a new
>>>>> class and do your work there.  So to get the view direction, for example,
>>>>> you would call:
>>>>>
>>>>> vesCamera::Ptr camera = app->camera();
>>>>> vesVector3f viewDirection = camera->focalPoint() - camera->position();
>>>>>
>>>>> To get the XYZ points, again that depends on how your application is
>>>>> using VES.  You can get the XYZ points from a vtkPolyData object after you
>>>>> read data, or you can get the points from the vesGeometryData object which
>>>>> holds the rendering vertex arrays.
>>>>>
>>>>> You might try following some introductory VTK tutorials to become more
>>>>> familiar with using the VTK library:
>>>>>
>>>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx
>>>>>
>>>>> Pat
>>>>>
>>>>> On Sun, Jan 20, 2013 at 5:17 PM, SHAMSUDHEEN TK <shamsutk87 at gmail.com>wrote:
>>>>>
>>>>>> Shamsudheen
>>>>>
>>>>>
>>>>>
>>>>> I'm really newbie with *VTK* and *VES*.
>>>>
>>>> I have successfully built the *VES/Kiwi* and have rendered one 3D obj
>>>> file in my iPad application.
>>>>
>>>> Great, I can rotate and zoom the object now using Gestures.
>>>>
>>>> *Now I would like to get the Angle or XYZ Points of a Rendered 3D
>>>> Object to identify the object position.*
>>>>
>>>> Is it possible? if yes, please share the details.
>>>>
>>>> Thanks,
>>>>
>>>> Shamsudheen
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20130121/11ccf44b/attachment-0001.html>


More information about the Ves mailing list