# Pixle Calc. Problem

Show 80 post(s) from this thread on one page
Page 2 of 2 First 12
• 03-23-2005
Shakti
1) Yes, it is as you guessed it, to allow the programmer to use the returnvalue if he or she wants to instead of setting a global flag.

2) I do that to have smaller values on speeds and suck. If I didnt multiply with 50.0f all values (read all speed-values) would have to be 50 times bigger than what they are now. This can by the way be any number of your choice, so it is not required for the function to work.

3) Because that is how you get the time elapsed betwean 2 QueryPerformanceCounter calls, you have to divide them with the frequency.
• 03-24-2005
loopshot
sorry but i dont really understand your second explination.

First off, whouldnt multiplying the time by a number over one, ie 50, make speed and other such values bigger, not smaller?

Second, i have changed that value a number of times and it has not altered the speed, or any such variable connected with time, like gravity. i changed it to 150, 200, 1, ect., so i did change it an amount that should of been noticeable. :confused:
• 03-24-2005
Sang-drax
Quote:

Originally Posted by loopshot
Second, i have changed that value a number of times and it has not altered the speed, or any such variable connected with time, like gravity. i changed it to 150, 200, 1, ect., so i did change it an amount that should of been noticeable. :confused:

You have to actually use procPower when you are calculating the movement of your objects.
• 03-25-2005
Shakti
Ok ill try to explain better, here is some code that I think will do:
Code:

```// This is what it looks like with that function as is: car.posX += car.speed*car.normalVectorX*procPower; car.posY += car.speed*car.normalVectorY*procPower;```
Now, if I didnt multiply with 50.0f when I calculate procPower car.speed would have to be 50 times bigger to get the same result.
Show 80 post(s) from this thread on one page
Page 2 of 2 First 12