Inserting a jpg image and rotating it?
Inserting a jpg image and rotating it?
I was wondering if it is possiable to insert a jpg image and then rotate it.
what do you mean by insert a jpg?
you want to draw a jpg onscreen and rotate it?
you can't get this functionality with draw2Dimage so i think you'll have to create a quad and apply the texture to it and then rotate that.
you can create a quad by creating a very simple hillplane node (check the smgr API) and then setting the texture and rotating the node.
you want to draw a jpg onscreen and rotate it?
you can't get this functionality with draw2Dimage so i think you'll have to create a quad and apply the texture to it and then rotate that.
you can create a quad by creating a very simple hillplane node (check the smgr API) and then setting the texture and rotating the node.
ok thanks for the help. Soz about the u beibng confused. Ill explain, u know last week i asked how i can animate a car and u said rotating the wheels. Well one of my models uses texturing i think its called UV texture or something so this means that my model doesnt hav a seperate wheel model instead the wheels are a jpg image of a wheel that when u look at the model it looks like they are 3d.
ok thanks. Just one more thing, which is i hav another model but this time i hav saved the wheels as a mesh so i can load them separately and was wonderin how to animate em cause last time u gave me code to just rotate, is there a way where they keep rotating so it looks like the wheels are rollin.
THANKS
THANKS
As i said before, you just rotate them a little bit more each frame. The extra amount that you rotate them each frame depends on how fast you want them to appear to move.
So
frame 1: rotate them 1 degree maybe
frame 2: rotate them 2 degrees maybe
so something like this:
So
frame 1: rotate them 1 degree maybe
frame 2: rotate them 2 degrees maybe
so something like this:
Code: Select all
void rotateWheel() {
static float rotation = 0;
wheelNode->setRotation(vector3df(rotation,0,0)); // or on the z axis if necessary
rotation++;
}sorry for keep askin but i hav added that code and got 2 errors.
this is wat i hav:
the first error is on the static line it says expected initalizer before "static"
the second error is on the line below and it says 'Rotation' was not declared in this scope.
the first error i dont really understand but i can remember me gettin a few of them wen i was doin a java project. the second error just confuses me cause i hav declared rotation in the static line.
i added the code in the main class so int main below where i add my nodes, thats where i got my 2 errors. Then i copyed the same code and added it before the int main and worked but there was no rotation and yes i changed all the numbers.
I dont mind which one u help with just plz help.
this is wat i hav:
Code: Select all
{
void rotateWheel()
static float rotation = 0;
node3->setRotation(vector3df(rotation,0,0)); // or on the z axis if necessary
rotation++;
}the second error is on the line below and it says 'Rotation' was not declared in this scope.
the first error i dont really understand but i can remember me gettin a few of them wen i was doin a java project. the second error just confuses me cause i hav declared rotation in the static line.
i added the code in the main class so int main below where i add my nodes, thats where i got my 2 errors. Then i copyed the same code and added it before the int main and worked but there was no rotation and yes i changed all the numbers.
I dont mind which one u help with just plz help.
it must be
Code: Select all
void rotateWheel()
{
static float rotation = 0;
node3->setRotation(vector3df(rotation,0,0)); // or on the z axis if necessary
rotation++;
}I think you're missing the very basics of C/C++ !!!Ravi08 wrote:do u think im missin a namespace or something?
you should realy learn this first of all !!!
http://www.cplusplus.com/doc/tutorial/
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
