I'm interested in creating a texture of a specific area in my scene, similar to the example shown in the official documentation for three.js framebuffer here. As I examine the code provided, there's one particular aspect that's unclear to me,
// Calculate the starting position for data copying
vector.x = ( window.innerWidth * dpr / 2 ) - ( textureSize / 2 );
vector.y = ( window.innerHeight * dpr / 2 ) - ( textureSize / 2 );
renderer.copyFramebufferToTexture( vector, texture );
The initial parameter for copyFrameBufferToTexture is a Vector2 representing the beginning point for copying the data.
What is the significance of these formulas?
Do they pertain to world coordinates or screen coordinates?
My goal is to dynamically insert a div element into the HTML document and then extract all pixel data contained within it.