# Read PLY and texture

**URL:** https://discourse.vtk.org/t/read-ply-and-texture/10673
**Category:** Support
**Created:** [February 14, 2023, 3:18pm UTC](https://discourse.vtk.org/t/read-ply-and-texture/10673 "2023-02-14T15:18:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![micheleivani](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@micheleivani](https://discourse.vtk.org/u/micheleivani)
#### Post date: [February 14, 2023, 3:18pm UTC](https://discourse.vtk.org/t/read-ply-and-texture/10673/1 "2023-02-14T15:18:49Z")

</div>

Hello,

I have a ply file and the realated texture in a separate JPG file. How can I render the 3D window the model with the colors?

```auto
var filename = Path.Combine(basePath, "lower.ply");
var filenameTexture = Path.Combine(basePath, "lower.jpg");

var textureFile = vtkImageReader2.New();
textureFile.SetFileName(filenameTexture);
textureFile.Update();

var atext = vtkTexture.New();
atext.SetInputConnection(textureFile.GetOutputPort());
atext.InterpolateOn();

var reader = new vtkPLYReader();
reader.SetFileName(filename);
reader.Update();

var mapper = vtkPolyDataMapper.New();
mapper.SetInputConnection(reader.GetOutputPort());
mapper.ScalarVisibilityOn();
mapper.Update();

var actor = vtkActor.New();
actor.SetMapper(mapper);
actor.SetTexture(atext);

Renderer.AddActor(actor);

```

@LucasGandel

Thank you.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [February 14, 2023, 10:25pm UTC](https://discourse.vtk.org/t/read-ply-and-texture/10673/2 "2023-02-14T22:25:11Z")

</div>

Hello,

I believe your code is missing a `vtkRenderWindow`. Please, take a look at these examples: [https://www.programcreek.com/python/example/9480/vtk.vtkRenderWindow](https://www.programcreek.com/python/example/9480/vtk.vtkRenderWindow)

take care,

Paulo
