• Advertisement
Sign in to follow this  

OpenGL help on this please?

This topic is 3992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

for(int i = 0 ; i < 3 ; i++) { vasp enemyvasp = {(rand()%10-10),(rand()%10-10), (float)(20-(rand()%30))/vaspSpeed, (float)(20-(rand()%30))/vaspSpeed} ; Enemy.push_back(enemyvasp); } The numbers 10-10 in the vasp enemyvasp = {(rand()%10-10),(rand()%10-10), Line should put the "vasps" that i will be drawn somewhere else in the program in some location at the "screen" tho when none of my drawings has any "zoom" the glTranslatef(xcoord,ycoord,zoom) so the screen aint really tremendous. Problem is the "vasps" (quads) will not show up on the "screen" any ideas on what numbers to use? or how to make the rand over to a float or double? vasp is a struct struct vasp { float x ; // vasp X position float y ; // vasp Y position float vaspmoveX ; // vasp X movement float vaspmoveY ; // vasp Y movement };

Share this post


Link to post
Share on other sites
Advertisement
This..
(rand()%10-10)
is the same as doing
rand()%0
because the 10-10 is evaluated first.
Try ((rand()%10)-10).

Degra

Share this post


Link to post
Share on other sites
Thanks Degra, tho i noticed the flaw in my code was not just those numbers, but made it work now thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement