Ok, deepcopying the output of <span>vtkTextureMapToPlane to a polydata, changing polydata's point data and mapping that polydata works fine. The question is: where are the texture coordinates</span> saved to? I printed the polydata copied from
<span>vtkTextureMapToPlane but it has 0 Tcoords. However I map it with a Polydatamapper and add it to an actor with a texture and it has the correct texture coordinates of </span><span>vtkTextureMapToPlane. </span><br><br>
<div><span class="gmail_quote">On 9/4/07, <b class="gmail_sendername">Wes Turner</b> <<a href="mailto:wes.turner@kitware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">wes.turner@kitware.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You shouldn't change the point coordinates at the output of a filter ... the output is generated automatically based on the input to the filter and your changes will be lost the next time that the filter executes. If you need to change the point coordinates, you need to first disconnect the output from the pipeline. An easy way to do this is to declare a new PolyData and do a deep copy from the output of the filter into the new PolyData. Once you do this, you should find that any changes you make to the new persist.
<br><br>- Wes<div><span><br><br><div><span class="gmail_quote">On 9/4/07, <b class="gmail_sendername">Samuel Marcos</b> <<a href="mailto:godofredoiii@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
godofredoiii@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Tim, many thanks<br>I've read something similar in another thread. I've been trying to add texture coords in a simple example using vtkjpegreader, but I don't get any good results. What I do is to add Tcoords to a polydata, then map the polydata whit a Polydatamapper and then add the mapper and a texture to the actor. Is that correct?
<br>Also I would like to keep the question of my first post hot: Is it possible to change Polydata point values in a vtkTextureMapToPlane but keeping the rest of the information? <div><span>
<br><br><div><span class="gmail_quote">On 9/3/07,
<b class="gmail_sendername">Tim Hutton</b> <<a href="mailto:tim.hutton@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tim.hutton@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Godofredo,<br><br>VTK doesn't support per-face texturing natively. You can get the same<br>effect by splitting the vertices - duplicating them so that at a<br>junction between e.g. 6 triangles, there are 6 vertices, all with the
<br>same spatial coordinates but different texture coordinates.<br><br>If you look in vtkOBJReader that's the approach it uses where<br>necessary, to read-in the OBJ format (which does support per-face<br>textures).<br>
<br>To manipulate the texture coordinates, just use<br>my_polydata->GetPointData()->GetTCoords().<br><br>Tim<br><br>On 03/09/07, Godofredo <<a href="mailto:godofredoiii@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
godofredoiii@gmail.com</a>> wrote:
<br>><br>> Sorry for replying myself but I'm frustrated. Another question I have: Is it<br>> possible to change Polydata point values in a vtkTextureMapToPlane? I've<br>> tried doing:<br>> vtkTextureMapToPlane *planeMap = vtkTextureMapToPlane::New();
<br>> planeMap->GetPolyDataOutput()->SetPoints(vPoints);<br>> Where vPoints is the new array of point values.<br>><br>> But this doesn't seem to work at all.<br>><br>><br>> Godofredo wrote:
<br>
> ><br>> > Hi. I'm trying to add texture to a region of a 3d polydata. The texture is<br>> > a .jpeg file and the polydata is a triangulated point cloud. I would like<br>> > to know if it's possible to manually assign a region of the .jpeg image to
<br>> > each triangle. I don't know if this can be done with the tcoords field.<br>> > Any guidance will be apreciated as I'm a bit stuck. Many thanks in<br>> > andvance<br>> ><br>><br>
> --
<br>> View this message in context: <a href="http://www.nabble.com/Per-triangle-texturing.-Please-help%21%21-tf4371233.html#a12460175" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.nabble.com/Per-triangle-texturing.-Please-help%21%21-tf4371233.html#a12460175
</a><br>> Sent from the VTK - Users mailing list archive at <a href="http://Nabble.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nabble.com</a>.<br>><br>> _______________________________________________
<br>> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ</a><br>> Follow this link to subscribe/unsubscribe:
<br>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br>><br><br><br>--<br>Tim Hutton - <a href="http://www.sq3.org.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.sq3.org.uk</a><br><br>
Take the Organic Builder challenge -<br><a href="http://www.sq3.org.uk/Evolution/Squirm3/OrganicBuilder/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.sq3.org.uk/Evolution/Squirm3/OrganicBuilder/</a><br></blockquote></div><br>
</span></div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br></blockquote></div><br><br clear="all"><br>-- <br></span></div>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>R&D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x120
</blockquote></div><br>