[vtkusers] [Simplest Way To] : Texture coords to corresponding scalars ?

Tim Hutton T.Hutton at eastman.ucl.ac.uk
Mon Sep 11 06:59:10 EDT 2000

As far as I know there is no easier way. I do almost the same thing
backwards - find the point on a mesh that corresponds to a location on the
texture - and that's much more fun...


At 01:22 10/09/00 +0200, you wrote:
>Given a texture coords (s,t) at a point P, and a 2D vtkTexture (that is 
>supposed to be bound to the actor displaying the dataset of P), what's the 
>quickest/easiest way to get the scalar(s) (color or grayscale) of the pixel 
>at (s, t) in that texture, given the texture parameter (Repeat and so) ?
>For the moment, texture->GetInput() gives me the structured point (image) 
>used by the texture, then using its dimensions and the relative coordinates 
>(s, t) in (0.0->1.0), I'm able to find the corresponding point ID 
>(ComputePointId), then the scalars, etc.
>Any shortcut ?
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at:
>Follow this link to subscribe/unsubscribe:
Tim Hutton, Research Assistant,    http://www.eastman.ucl.ac.uk/~dmi/MINORI
MINORI Project,                           Email: T.Hutton at eastman.ucl.ac.uk
Informatics Unit (Media Centre),      Permanent: T.Hutton at mail.com
Eastman Dental Institute, UCL,                        Tel: +44 20 7915 2344
256 Gray's Inn Road, London WC1X 8LD, UK              Fax: +44 20 7915 2303
This email represents the views of the sender alone and must not be
construed as representing the views of the Eastman Dental Institute. It may
contain confidential information and may be protected by law as a legally
privileged document and copyright work. Its content should not be disclosed
and it should not be given or copied to anyone other than the person(s)
named or referenced above. If you have received this email in error, please
contact the sender.

More information about the vtkusers mailing list