Basically, I want to draw part of the video to a certain area of the canvas.
firstly, I will do:
But instead of drawing the entire texture on the screen, I want to draw only a certain area, say: within the rectangle of (0,0),(80,80), the texture is visible. Otherwise the texture is invisible.
How can I do it?
Thanks ahead for any advice!
There are several ways to do that. One would be to draw the videoTexture into a FBO of the preferred size and then draw that FBO to the screen. … Search for FBO in the forum.
The easiest way IMO is to make a textured quad where the texture coordinates are are set such that the texture is effectively cropped.
something like this: