Sign in to follow this  
Pettah

OpenGL help on this please?

Recommended Posts

Pettah    122
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
Degra    212
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this