Thank you Eric very much!<br>Your advise is very important for me, I have searched the old mailing list, but most of the problem about 3DSImpoter is no result. I think you are right, the designer need send me another file format.<br>
<br>Yun<br><br><div class="gmail_quote">2010/9/26 Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hey Yun,<br>
<br>
I've never used the vtk3DSImporter (or dotnet), but I would guess that if the importer has problems with textures, then probably it's not just losing the textures, but it's also not importing the texture coordinates. So, when you try to apply a texture manually there is nothing to tell the system where to put the texture.<br>
<br>
I have a feeling, looking back on old mailing list postings, that the 3DSImporter really just grabs the most basic geometry, and computes Normals, but it's not designed to pull in anything more than the polygons. I'm sure this will disappoint you, but maybe there's a chance someone else has another solution for converting your file into another format...?<br>
<br>
Good luck,<br>
-Eric<br>
<br>
------------------------------------------------------<br>
Eric E Monson<br>
Duke Visualization Technology Group<br>
<div><div></div><div class="h5"><br>
<br>
On Sep 25, 2010, at 11:22 AM, quengzi wrote:<br>
<br>
> Hi all,<br>
><br>
> I'm a newer of VTK, I use VTK Dotnet to open a 3ds file, someone tell me that vtk3DSImpoter do not support texture, so I want to draw it by manual, but it failed, I cannot see any different after add the texture by manual, below is my code:<br>
> string fileName = @"E:\VTK\3D Module\Mickey\Mickey.3ds";<br>
> vtk3DSImporter importer = new vtk3DSImporter();<br>
> importer.ComputeNormalsOn();<br>
> importer.SetFileName(fileName);<br>
> importer.Read();<br>
> importer.GetRenderer().ResetCamera();<br>
> importer.DebugOn();<br>
><br>
> //Add or Remove this section, no differents<br>
> vtkPNGReader pngReader = new vtkPNGReader();<br>
> pngReader.SetDebug(1);<br>
> pngReader.SetFileName(@"E:\VTK\3D Module\Mickey\l.png");<br>
> vtkTexture texture = new vtkTexture();<br>
> texture.SetInput(pngReader.GetOutput());<br>
> texture.InterpolateOn();<br>
> vtkActor actor = new vtkActor();<br>
> actor.SetTexture(texture);<br>
> importer.GetRenderer().AddActor(actor);<br>
><br>
> //Below is add a light, and it's okay<br>
> vtkLight light = new vtkLight();<br>
> light.SetColor(1,1 , 1);<br>
> light.SwitchOn();<br>
> light.SetIntensity(0.9);<br>
> light.SetAmbientColor(1, 1, 1);<br>
> light.SetPosition(importer.GetRenderer().GetActiveCamera().GetPosition());<br>
> light.SetFocalPoint(importer.GetRenderer().GetActiveCamera().GetFocalPoint());<br>
><br>
> importer.GetRenderer().SetBackground(0.1,0.2,0.4);<br>
> importer.GetRenderer().AddLight(light);<br>
><br>
> renderer[0] = importer.GetRenderer();<br>
> AddRendererToRenderWindow(renWin);<br>
> ...<br>
> Any suggestions will be appropriated.<br>
><br>
> Thanks,<br>
> Yun<br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote></div><br>