getting rotation on only one axis

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
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

getting rotation on only one axis

Post by 3DModelerMan »

Hi I am trying to implement local transformations, so I have to get the characters rotation vectors, but when I try to get only one, like this

Code: Select all

wolf_X_vector = main_player_wolf->getRotation().X;
wolf_Y_vector = main_player_wolf->getRotation().Y;
wolf_Z_vector = main_player_wolf->getRotation().Z;
I get a compile error, but when I take out the .Z etc, it compiles fine. What's wrong here?.
Thanks :D .
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: getting rotation on only one axis

Post by Acki »

3DModelerMan wrote:I get a compile error
Yeah, I also get compile errors some times, but there are so many different compile errors possible !!! :twisted:

and is this your actual code snippet or just an illustration of what you did ???

or shall we simply guess !?!?! :roll:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

don't feed the ....

Let JP handle it.
Image
zeno60
Posts: 342
Joined: Sun May 21, 2006 2:48 am
Location: NC, USA
Contact:

Post by zeno60 »

n/m
Last edited by zeno60 on Fri Sep 12, 2008 10:24 pm, edited 1 time in total.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

I guess that wolf_X_vector, wolf_Y_vector, wolf_Z_vector are vectors like the names say and you are trying to assign an integer to a vector^^
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Sudi wrote:I guess that wolf_X_vector, wolf_Y_vector, wolf_Z_vector are vectors like the names say and you are trying to assign an integer to a vector^^
Aren't they floating-point values? At any rate, the compile error should give enough information for you to deduce the problems.

Code: Select all

core::vector3df rotation = node->getRotation();
irr::f32 rotX = rotation.X;
irr::f32 rotY = rotation.Y;
irr::f32 rotZ = rotation.Z;
I would assign them to specific stack variables, but rather I would just use them from the vector. Simple as that.

But anyways. If you want real help, then post real code snippets for people to help you with. It just so happens that this was easy to find out. (If that is even the problem, because you could have just named the variables with a 'vector' not even knowing the definition of what 'vector' means.) But at the end of the day, we don't know, because your code snippet didn't give enough information.

My $0.02.
TheQuestion = 2B || !2B
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

umm

Post by 3DModelerMan »

That was my exact code snipet. And thanks :D .
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Re: umm

Post by Halifax »

3DModelerMan wrote:That was my exact code snipet. And thanks :D .
No problem.
TheQuestion = 2B || !2B
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

by the way...

Post by 3DModelerMan »

I really apreciate the help you guys have given me so far, even though my questions are kinda dopey.
Thanks :D .

And by the way, it worked!, now all I have to do is search for what the math to move it was.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Re: by the way...

Post by Halifax »

3DModelerMan wrote:I really apreciate the help you guys have given me so far, even though my questions are kinda dopey.
Thanks :D .

And by the way, it worked!, now all I have to do is search for what the math to move it was.
Your going to want to use trigonometry. Specifically the functions sin() and cos().
TheQuestion = 2B || !2B
Post Reply