Getting ofTexture Coordinates on ofFbo

Hello,

I am trying to figure out how to get the coordinates of the pixels of a texture on an ofFbo, anyone have any ideas on how to get that?

Many Thanks!

Is there something wrong with my question??

it’s not very clear what you mean, can you explain a little bit more what you want to do?

Sure, sorry for the lack of clarity.

So what I’m currently doing is drawing an ofFbo object to the screen that contains a single ofTexture object.

Now, this ofTexture is drawn to a random position on the ofFbo object.

Now, what I want to do, is to get the relative position of each pixel of the ofTexture to the ofFbo object.

So if I had an ofTexture object, and it’s width was 200 pixels and it’s height was 200 pixels, and if it was drawn to a positions x:100 and y:100 on the ofFbo object, then the first pixel of the ofTexture object would be drawn to a coordinate c(x, y) = c(100, 100) and the 2nd pixel of the ofTexture would be drawn to c(x, y) = c(101, 100), and the 3rd pixel of the ofTexture would be drawn to c(x, y) = c(102, 100)… and so on

What I want, is basically to develop a method, that would give me those relative coordinates of each pixel of the ofTexture object on ofFbo object.

If there still any misconceptions, please do say and I will try to clear them up!

this depends on how the perspective is setup, if you are using a camera… but with the default OF settings if you draw at 100,100 the texture will be drawn at 100,100 in the fbo texture.if you then draw the fbo at 100,100 again you just need to add the 2 coordinates what gives you that the texture will be finally at 200,200