space wars

Started by
18 comments, last by phil67rpg 10 years, 5 months ago


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.

Advertisement

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?


Is it viable to draw it on the center, rotate it and then move it?
yes it is.


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?
yes all the changes have been implemented. I have swapped the rotate and translate functions but no success.

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.

To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.

here is a screen shot.[attachment=18404:space.png]

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).


I think you need to find the offset that will place your ship at the centre then rotate and put the offset back.
do you mean use pushmatrix and popmatrix.

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

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

I would like to solve this problem before I go any further.

well I have not posted in a long time, I have been reading opengl programming guide 8th ed. I am going back to my space wars game. I need some help with the above problem.

This topic is closed to new replies.

Advertisement