Page 1 of 1

Loading 2D image into 3D space

Posted: Tue May 03, 2011 1:46 pm
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

Posted: Tue May 03, 2011 3:26 pm
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);