```
if (vidGrabber.isFrameNew()){
for (int i=0; i<vidGrabber.getWidth()*vidGrabber.getHeight(); i++){
ofFloatColor sampleColor(vidGrabber.getPixels()[i*3]/255.f, // r
vidGrabber.getPixels()[i*3+1]/255.f, // g
vidGrabber.getPixels()[i*3+2]/255.f); // b
glm::vec3 tmpVec = mainMesh.getVertex(i);
tmpVec.z = sampleColor.getBrightness() * extrusionAmount;
mainMesh.setVertex(i, tmpVec);
mainMesh.setColor(i, sampleColor);
}
}
```

ofFloatColor sampleColor(vidGrabber.getPixels()[i*3]/255.f

I know that this function stores the color of the i-th pixel.

But I don’t know why you multiply i by 3.

And I’m curious why you divide 255.

I think I’m such a beginner…