Loading 2D image into 3D space

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jomille
Posts: 1
Joined: Tue May 03, 2011 1:31 pm

Loading 2D image into 3D space

Post by jomille »

Not sure if the subject really describes what I am trying to do but I am kind of new to this so please feel free to educate and correct me.

Basically I have a 2D image that I would like to display in a 3D environment. Essentially, I would like to load a JPG into a 3D "world" then use mouse controls to rotate, pan, zoom, etc. this 2D image and view it at different angles. I know a billboard background is loading a 2D image into a 3D scene but that is always perpendicular to the camera whereas I want to interact with the image.

Any directions you could point me or code snippets?

Thanks

-Jesse
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Post by Iyad »

Create a plane. Add your texture image. Rotate it where you need.
If you are a begginer in 3D developpement and you don't know how to manually create meshes: create a cube (cube scene node), set it z scale to 0, add your texture image and rotate it...

Code: Select all

ISceneNode* node = scenemanager()->addCubeSceneNode();
node->setScale(vector3df(1.f,1.f,0.f));
ITexture* planeTexture->videodriver()->addTexture("myImage.jpg");
node->setMaterialTexture(0, planeTexture);
node->setRotation(X,Y,Z);
#include <Iyad.h>
Post Reply