[vtkusers] flip 2D text

Tamas Ungi ungi.tamas at gmail.com
Tue Feb 16 15:35:10 EST 2010


Hi David and Eric,

Thanks for the suggestions.
I ended up by subclassing vtkTextActor, and overriding the
ComputeRectangle function. this->RectanglePoints define the
coordinates for positioning the text image. I exchanged the points, so
the text now appears flipped.

It seems that this feature is not yet supported by VTK, so I will try
to contact a developer, and have her/him commit this change in the
public code.

Cheers,
Tamas



On Tue, Feb 16, 2010 at 2:54 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> I think that TextActor3D is the best solution, but it is not a trivial solution.
>
> It would also require a separate overlay renderer (with EraseOff() and
> InteractionOff()) and the overlay renderer would need to be set up for
> a parallel projection where world coordinates and display coordinates
> are equal to each other, except of course for your desired flip.  I.e.
> you would put the camera behind instead of putting it in front.
>
> The overlay renderer would be convenient to have in general, because
> it would allow you to use whatever kind of 3D actors you want as an
> overlay.  That way you won't have to mess around with 2D actors at
> all.
>
>   David
>
>
> On Tue, Feb 16, 2010 at 12:28 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>> Hey Tamas,
>>
>> I'm not an expert in this, but after looking at it for a few minutes I have a feeling you'll need to either use a vtkTextActor3D in which you can do a SetUserTransform() (but the text would naturally move with your scene), or you could use something like a vtkTexturedActor2D and just reverse your text in the texture image.
>>
>> Hopefully someone else will have a better solution...
>>
>> -Eric
>>
>> ------------------------------------------------------
>> Eric E Monson
>> Duke Visualization Technology Group
>>
>>
>> On Feb 15, 2010, at 6:21 PM, Tamas Ungi wrote:
>>
>>> Hi,
>>>
>>> I am developing an augmented reality system, where the image of the
>>> monitor is looked at through a mirror. Therefore, I need to flip the
>>> texts, but vtkTextActor seems to have only a SetOrientation function,
>>> and I didn't find a way to apply a vtkTransform either.
>>> Could you suggest a way to flip 2D texts on the monitor?
>>>
>>> Thank you,
>>> Tamas
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>



-- 
Tamas Ungi
Postdoctoral Research Fellow
Laboratory for Percutaneous Surgery
Queen's University, School of Computing
#747 Goodwin Hall, 25 Union St.
Kingston, ON, K7L 3N6, CANADA
Tel: 1-613-483-3122
Email: ungi at cs.queensu.ca



More information about the vtkusers mailing list