[vtkusers] How to insert a mirror in a VTK scene?

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Mon Sep 16 18:02:43 EDT 2002


Salut Pierre,
   Try a search on the vtk list archive
(http://www.kitware.com/search.html) with 'mirror' or 'reflection', there
has been some discussion on this in the past.
A quick and dirty mirror can be made by applying a transform to the data
set: vtkTransform->Scale( 1, 1, -1 ). The negative value will 'reflect' the
input geometry through the origin in the chosen direction.  The OpenGL site
has detailed information on how to use this method.

  regards
     Dave Pont



|--------+--------------------------------->
|        |          Tim Hutton             |
|        |          <T.Hutton at eastman.ucl.a|
|        |          c.uk>                  |
|        |          Sent by:               |
|        |          vtkusers-admin at public.k|
|        |          itware.com             |
|        |                                 |
|        |                                 |
|        |          16/09/2002 22:32       |
|        |                                 |
|--------+--------------------------------->
  >------------------------------------------------------------------------------------------------------------|
  |                                                                                                            |
  |      To:     Pierre MAYENOBE <mayenobe at lasmea.univ-bpclermont.fr>, vtkusers at public.kitware.com             |
  |      cc:                                                                                                   |
  |      Subject:     Re: [vtkusers] How to insert a mirror in a VTK scene?                                    |
  >------------------------------------------------------------------------------------------------------------|




Hi Pierre,

I was having a go at that a while back, it shouldn't be that hard. Basic
technique is to work out where the mirrored observer is, render a scene
from that viewpoint and use the rendering as a texture on the mirror object

in the final scene. When the observer moves the reflection needs to be
re-rendered of course.

Spherical mirrors would be a different matter... in theory the principle
extends to arbitrarily curved shiny surfaces (basically render from a
different viewpoint).

Attached a tcl script that has some of the framework.

Let us know how you get on!

Tim.


At 12:21 16/09/2002 +0200, you wrote:
>Hi everybody,
>
>Could someone explain me how to modelise a mirror in VTK or whether it's
>possible at a low computational cost?
>Thanks a lot and have a nice day everybody!
>
>P. Mayenobe
>PhD student in France (and VTK user, indeed...)
(See attached file: reflectingSphere.tcl)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reflectingSphere.tcl
Type: application/octet-stream
Size: 2962 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020917/a134748b/attachment.obj>


More information about the vtkusers mailing list