<br><font size=2 face="sans-serif">Maybe.....you offering?? I don't see this in the cvs...john</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>David.Pont@forestresearch.co.nz</b></font>
<p><font size=1 face="sans-serif">05/06/2004 08:13 PM</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: "John Biddiscombe" <jbiddiscombe@skippingmouse.co.uk></font>
<br><font size=1 face="sans-serif"> cc: John Anast-JM/PGI@PGI, vtkusers@vtk.org</font>
<br><font size=1 face="sans-serif"> Subject: Re: [vtkusers] texture map to cube</font></table>
<br>
<br>
<br><font size=2 face="Courier New"><br>
Is vtkTextureMapToBox any use?<br>
Dave P<br>
<br>
<br>
<br>
|---------+----------------------------------><br>
| | "John Biddiscombe" |<br>
| | <jbiddiscombe@skippingm|<br>
| | ouse.co.uk> |<br>
| | Sent by: |<br>
| | vtkusers-admin@vtk.org |<br>
| | |<br>
| | |<br>
| | 07/05/2004 11:47 |<br>
| | |<br>
|---------+----------------------------------><br>
>------------------------------------------------------------------------------------------------------------|<br>
| |<br>
| To: <vtkusers@vtk.org>, <anast.jm@pg.com> |<br>
| cc: |<br>
| Subject: Re: [vtkusers] texture map to cube |<br>
>------------------------------------------------------------------------------------------------------------|<br>
<br>
<br>
<br>
<br>
This will never work with TextureMapToPlane. It projects the points onto a<br>
plane and so only 2 faces will ever look reasonable.<br>
<br>
What you need is an image which is an unfolded cube and then write a<br>
texturemaptocube which computes the texture coords correctly<br>
<br>
------<br>
| +Z |<br>
------<br>
---------------------<br>
| -X | -Y | +X | +Y |<br>
---------------------<br>
------<br>
| -Z |<br>
------<br>
<br>
like this, then compute the texcoords from the offsets. Is that what you're<br>
trying to do?<br>
<br>
JB<br>
<br>
<br>
<br>
----- Original Message -----<br>
From: <anast.jm@pg.com><br>
To: <vtkusers@vtk.org><br>
Sent: Thursday, May 06, 2004 9:57 PM<br>
Subject: Re: [vtkusers] texture map to cube</font>
<br><font size=2 face="Courier New"><br>
<br>
> Dean,<br>
><br>
> My code is very similar to yours and I couldn't get this to work either.<br>
> Its not very intuitive. If the cube's origin is correct and the extent 1<br>
> in all directions and Repeat is On, I can get an exact copy of my image<br>
on<br>
> all cube faces. If repeat is off, then I get two faces filled, and a very<br>
> light smear on two other faces with the top and bottom blank. I've tried<br>
> zillions of extent combos with origin offsets and can make heads or tails<br>
> out of it. I tried maping to sphere too but I couldn't see anything.<br>
><br>
> What are you seeing....john<br>
><br>
><br>
><br>
><br>
><br>
> "Dean Inglis" <dean.inglis@camris.ca><br>
> Sent by: vtkusers-admin@vtk.org<br>
> 05/06/2004 02:25 PM<br>
><br>
><br>
> To: "vtkusers archive" <vtkusers@vtk.org><br>
> cc: (bcc: John Anast-JM/PGI)<br>
> Subject: [vtkusers] texture map to cube<br>
><br>
><br>
> I am trying to texture map a set of 6 face labels<br>
> to a cube. So far I am just trying to map 4 of<br>
> the faces with +/- coordinate face labels. The input<br>
> image looks like this:<br>
><br>
> ---------------------<br>
> | -X | -Y | +X | +Y |<br>
> ---------------------<br>
><br>
> The unsuccessful pipeline is:<br>
><br>
> package require vtk<br>
> package require vtkinteraction<br>
><br>
> vtkCubeSource cube<br>
> cube SetBounds -1 1 -1 1 -1 1<br>
><br>
> vtkTextureMapToPlane tmap<br>
> #vtkTextureMapToCylinder tmap<br>
> tmap SetInput [cube GetOutput]<br>
> #tmap AutomaticPlaneGenerationOn<br>
><br>
> vtkPolyDataMapper pmap<br>
> pmap SetInput [tmap GetOutput]<br>
><br>
> vtkPNGReader reader<br>
> reader SetFileName "testwrap.png"<br>
><br>
> vtkTexture texture<br>
> texture SetQualityTo32Bit<br>
> texture InterpolateOn<br>
> #texture RepeatOn<br>
> texture RepeatOff<br>
> texture SetInput [reader GetOutput]<br>
><br>
> vtkActor tact<br>
> tact SetMapper pmap<br>
> tact SetTexture texture<br>
><br>
><br>
> # Create graphics stuff<br>
> #<br>
> vtkRenderer ren1<br>
> vtkRenderWindow renWin<br>
> renWin AddRenderer ren1<br>
> vtkRenderWindowInteractor iren<br>
> iren SetRenderWindow renWin<br>
><br>
> # Add the actors to the renderer, set the background and size<br>
> ren1 AddActor tact<br>
><br>
> ren1 ResetCameraClippingRange<br>
> ren1 SetBackground 0 .5 .4<br>
><br>
> renWin SetSize 800 800<br>
> iren Initialize<br>
><br>
> # render the image<br>
> #<br>
> iren AddObserver UserEvent {wm deiconify .vtkInteract}<br>
><br>
> # prevent the tk window from showing up then start the event loop<br>
> wm withdraw .<br>
><br>
><br>
> any hints? thanks,<br>
> Dean<br>
><br>
> _______________________________________________<br>
> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at:<br>
> <http://public.kitware.com/cgi-bin/vtkfaq><br>
> Follow this link to subscribe/unsubscribe:<br>
> http://www.vtk.org/mailman/listinfo/vtkusers<br>
><br>
><br>
><br>
<br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <<br>
http://public.kitware.com/cgi-bin/vtkfaq><br>
Follow this link to subscribe/unsubscribe:<br>
http://www.vtk.org/mailman/listinfo/vtkusers<br>
</font>
<br><font size=2 face="Courier New">_<br>
<br>
<br>
<br>
<br>
</font>
<br>
<br>