Assign an image to a grid

Hi,

I have 1 ofImage object with loaded .jpg
I am trying to assign this as texture to a grid or a rect in 3d space.
What is fast trial for this one?

you could quad warp it or bind it to a mesh and add a camera to your project

in your ofApp.h file:

void setup();
void draw();
//...
ofImage img; // your image
ofEasyCam cam;

in your ofApp.cpp file

/// ...
void ofApp::setup()
{
 // load your image
}
/// ...
void ofApp::draw()
{
  ofBackground(0);
  cam.begin();
  img.draw(0,0);
  cam.end();
}
/// ...

I wanted to implement drawing an image that is tilt to camera direction.
Above would not allow rotation on the image in z axis (3d-space)?

m_cam.begin();

ofPushMatrix();

m_gMapView.draw( 100, 100, 10 );
ofRotate( 30, 1, 1, 0 );

ofPopMatrix();

m_cam.end();

Perhaps rotate first, then draw?

ofRotate( 30, 1, 1, 0 );
m_gMapView.draw( 100, 100, 10 );

thanks for the fix :smile: