translation rotation

my problem is i have an helicopter that is looking towards x axis. i want the helicopter move along all directions using x key for forword and X key for backwrd . the helicopter moves only fornt and back direction of its. if i rotate the helicopter in 90 degree y axis means then the helicopter must go front direction of the it now that is z axis.



this is my helicopter

give me the solution for it friend

First, don’t cross-post. This isn’t an Advanced question, and it’s not worth annoying the Beginners with multiple posts.

Second, don’t ask folks to solve your problem. Nobody wants to do your homework or debug your code. Ask questions about what you don’t understand, and you’ll find lots of folks willing to help. You should read this: How to Ask Questions the Smart Way. If you don’t read anything else, read the Introduction.

Third, pick up the OpenGL Red Book, read the Viewing chapter, and try the tutorials. Once you’ve done that, you’ll have answered your question.

Other posts by you on the same topic here and here and here.

Sorry if this sounds offending, but it’s how I see it: Your solution is to be less ignorant and pay more attention to what you read.

First - you have posted twice to wrong forum, even though it’s very clearily written what each forum is for.

Second thing is that if you look at the beginners forum, you’ll see that first topic has a link to wiki page. On that page you’ll find article named “Getting started”. You shouldn’t have ignored that one, so go there now.

Read carefully. It will also point you to NEHE tutorials - make sure you go throught them, too.

sorry for my mistake ok. i never ask you to do this for me ok. no i never post this forum at all.i will try myself friends and gurus. if i know then why i am asking to you. ok any way i will take more time and i will teach you if bossible. take mistake me… ok good bye…
why i am sending so many forums nobody answered me i same forum. what can i do

one master can bring to 1000 masters if he worked hard. you are not ready to solve my broblem means what we can call you.
actually i my mother language is different i have to learned english and then i studied opengl with my selft. so only little conflict ok . so i left the rules to read.
i am not begging to do this. i can learn my self. i wont to be a master. i want to be a learner. if i am truth for myself i can learne myself. sorry for distrubing you all from your works . good bye…

Hmm, right i am a Mathematics student at uni for a few years now… so if i can help you… i must be really crap at applied math and pure math. rofl

Well so i am not totaly understanding what you mean.

I think before you start making it complicated with the whole 3D aspect of another dimension make it simple first then move on.

So what if we just take a 2d grid of x and y axis, and for me i think isnt it

-----------------------------> x

where the top left is co-ordinated (0,0);

So ok if we defined some sort of 2d shape to be a helicopter take a rectangle for sake of arguemnt, (i would be worried if helicopters were just a rectangle not even a platonic solid haha);

Anyways lets say we have our rectangle

| |
| |

say 1:(0,0) 2:(2,0) 3:(0,4) 4:(2,4)

lets say that its curently facing down.

so what would happen if we turned it 90 degrees or pi/2 rads clockwise

lets see

| |

so where are the co-ordinates now

well 3 seems to stay the same 3:(0,4)


1:(4,4) 2:(4,6)

so you can see a rotation you can do reflections just think of where the co-ordinates will be.

So your talking about roating things in 3D space:

for me from what i have learned that i should remember all off… but i dont haha think of vectors i am not sure how good your math knowlegde will be now, but if it isnt up to scratch i really reccoment a book on vector algebra and dynamics of particles or somthing like newtonion mechanics something like that

but anyways you will be looking for things about dot products cross products etc.

Your wanting to rotate an object though 90 degress in the y axis with respect to some other axis, immedietly this sounds complicated.

if you dont want to start getting too deep into mathematics just break it down so take it from the x-axis and y-axis perspective to find where a certain few vertices will be then do the same idea with the z-axis and y-axis perspective, try to visualise it as much as you can keep drawing it on a piece of paper or better yet get a few small shapes like cubes and cirlces (ellipse’s) etc

if you want to get a quick answer you can pretend your cylinder is a vector and you want to find what will happen that vector.


Lets say your cyclinder is face upward
in the y-axis


lets remember what our co-ordinate system is like in 3D

| /z
| /

its hard to show in ASC2 haha :stuck_out_tongue:

anyways so we have a cyclinder standing up right in the y axis

then if you wanted to find what the vector will be and its co-ordinates would be in another axis you can do the cross-product with the cyclinder vector and another axis

look at this don’t start looking at the matrix’s at the bottom only make things more confusing its handy when you start to understand it all

hmm actualy i’ll finish this later i have work to do hahaha