Hello, I am making a game and I have a pshape planet with 360 vertices placed in a circle.

```
PVector circ = new PVector(rad,0);
tar = createShape();
tar.beginShape();
//loops 359 times to enable rotation in 1° increments
for(int i = 1; i<360; i++)
{
//Creates a vertex at circ.x and circ.y
tar.vertex(circ.x,circ.y);
//Rotates circ by 1° converted to radians
circ.rotate(PI/180);
}
//Ends the shape
tar.endShape(CLOSE);
```

You throw meteors which hit the planet and move the vertices to make a crater. The meteors are objects of the class projectile which has float x,y,dim. The class also has velocity pvector and it shows an ellipse at x,y with diameter dim which is moved by the vel vector.

```
boolean collision(Projectile k)
{
//b gets the vertex information for optimization
PVector b;
//if collision is detected hit is set to true
boolean hit=false;
//Loops through the vertices to check which if any are hit
for(int i = 0;i<tar.getVertexCount();i++)
{
//The unfinished crater algorithm
b = tar.getVertex(i);
//Checks if the vertex is in contact with the projectile
if(dist(x + b.x,y + b.y,k.x,k.y)<k.dim/2)
{
//adds the projectiles velocity to any vertex in contact with the projectile
b.add(k.vel);
//sets the new vertex
tar.setVertex(i,b);
hit = true;
}
}
//if a collision occurred a hole is made where the projectile hit
return hit;
}
```

So the craters are a part of the pshape itself. In the end it looks like this

I would like to place an image on the planet in a way that the image is not warped in any way, and when the vertices are moved the crater part of the image disappears and the rest is still unchanged. I thought about using the texture function but I don’t know how I would do that. I also thought about going through the pixel array and changing all white pixels on the planet to corresponding pixels from the image of the planet, but the problem is the planet rotates using a rotate function I wrote that actually sets new location for all vertices using trigonometry. Any suggestion or idea would be appriciated