You mean it is rotating in an arc around the center of the screen?
Could you please post the code where you create the ship?
yes you are correct. I posted the code above.
You mean it is rotating in an arc around the center of the screen?
Could you please post the code where you create the ship?
yes you are correct. I posted the code above.
As I really don't know OpenGL, I can't be of much help to you.
I can't help but to notice that your code, as posted on the last post, isn't changed. Are you sure the changes were all saved and submitted when you swapped the rotate and translate functions?
Is it viable to draw it on the center, rotate it and then move it?
yes it is.
Is it viable to draw it on the center, rotate it and then move it?
yes all the changes have been implemented. I have swapped the rotate and translate functions but no success.
I can't help but to notice that your code, as posted on the last post, isn't changed. Are you sure the changes were all saved and submitted when you swapped the rotate and translate functions?
I suggest youpost some screenshots so it's easier to understand what's going wrong. Go back to your old unswapped code, take a screenshot or two with that, then repeat with the new swapped code.
Hello there.
I think you need to find the offset that will place your ship at the centre then rotate and put the offset back.
and like Trienco said.
Unless dealing with "outside influence" on your object, thinking in local coordinates is almost always more convenient and easier to reason about. It also means that nothing is actually happening "backwards".
but you can convert the outside influences to your models space too. I do this to rotate some objects based on a direction(heading vector fromw world coords).
do you mean use pushmatrix and popmatrix.
I think you need to find the offset that will place your ship at the centre then rotate and put the offset back.
I suggest learning modern openGL with glm, using the matrix objects will teach you more about whats really going on, also learning the modern way is a good thing.
If this post or signature was helpful and/or constructive please give rep.
// C++ Video tutorials
http://www.youtube.com/watch?v=Wo60USYV9Ik
// Easy to learn 2D Game Library c++
SFML2.2 Download http://www.sfml-dev.org/download.php
SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/
// Excellent 2d physics library Box2D
// SFML 2 book