Fps independent animation

hi.
what about the subj? How do i get it? Do you have any examples of it?

thanks for any help.

what about the subj? How do i get it? Do you have any examples of it?

Simple way which works well : Speed = Speed + Accel * Time; Pos = Pos +
Speed * Time

More mathematically correct, more complex, and (slightly) better
looking : the famous Olofson’s Pig ( http://olofson.net/mixed.html ) Not
as famous as Pavlov’s Dogs or Schroedinger’s Cat but it’s getting
there :wink:

I use the first method in all of our games and it works good enough.

–Gabriel–
Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel on Graphics - http://gabrielongraphics.blogspot.com

what about the subj? How do i get it? Do you have any examples of it?

Simple way which works well : Speed = Speed + Accel * Time; Pos = Pos +
Speed * Time

More mathematically correct, more complex, and (slightly) better
looking : the famous Olofson’s Pig ( http://olofson.net/mixed.html ) Not
as famous as Pavlov’s Dogs or Schroedinger’s Cat but it’s getting
there :wink:

I use the first method in all of our games and it works good enough.

–Gabriel

LOL :slight_smile:

Ok, so there are also Gaffer’s Physics Articles
(http://www.gaffer.org/articles/), IMHO very helpful when dealing with
physics. I have used the technique explained in Timestep section in my
last game, and it worked flawlessly. AFAIK, Olofson’s Pig uses the same
technique, that is, it decouples rendering loop from physics loop, and
it fixes the latter to a constant number of updates per second.

Koshmaar

what about the subj? How do i get it? Do you have any examples of it?

Simple way which works well : Speed = Speed + Accel * Time; Pos = Pos +
Speed * Time

More mathematically correct, more complex, and (slightly) better
looking : the famous Olofson’s Pig ( http://olofson.net/mixed.html ) Not
as famous as Pavlov’s Dogs or Schroedinger’s Cat but it’s getting
there :wink:

I use the first method in all of our games and it works good enough.

–Gabriel


Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel on Graphics - http://gabrielongraphics.blogspot.com

and what is the Time var??

i do this:


>         float start_t = 0.0f;
> 	float dt = 0.01f;
> 	
> 	float acumulator = 0.0f;
> 	float curtime = 0.0f;
> 	float delta_time = 0.0f;
> 
> 	fps_start = SDL_GetTicks();
> 	
> 	curtime = SDL_GetTicks();
> 
> 	int times = 0;
> 	
> 	while(!exit)
> 	{
> 		start_t = SDL_GetTicks();
> 		delta_time = start_t - curtime;
> 		curtime = SDL_GetTicks();
> 		
> 		acumulator += delta_time;
> 		
> 		
> 		if (acumulator >= dt)
> 		{
> 				
> 			CheckInput();
> 			SDL_FillRect(screen, NULL, 0x000000);
> 			ProcessCircle();
> 		
> 			SDL_Flip(screen);
> 			
> 			acumulator = 0;
> 			
> 			times++;
> 		}
> 		
> 		
> 		fps++;
> 		
> 		if ((SDL_GetTicks() - fps_start) >= 1000)
> 		{
> 			fps_start = SDL_GetTicks();
> 			printf("fps = %d\n", fps);
> 			printf("times = %d\n", times);
> 			times = 0;
> 			fps = 0;
> 		}
>       }

and fps and times prints the same values. whats wrong with them?
btw with any dt value the animation has the same speed :expressionless:

----- Original Message -----
From: mystml@adinet.com.uy (Gabriel Gambetta)
To: antonmasteR , SDL Mailing List
Date: Sun, 22 Jan 2006 14:46:27 -0300
Subject: Re: [SDL] fps independent animation

One of your biggest mistakes is that you are adding an int to a float.
SDL_GetTicks gives you milliseconds as an integer, not seconds as a float.
You’re checking to see whether or not your “acumulator” is >= .01f, when any
time that acumulator is incremented it’ll be in whole numbers! So it always
will be >= .01f , which would probably explain why you are getting
indentical values for times and fps.
I think you are using more variables than you really need. Or at least I’d
come up with clearer names for them - it’s hard to tell exactly what your
trying to accomplish by putting times++ inside the while loop, and fps++
outside of it… Intuitively, I think they ought to be reversed.

To fix things with minimal changes to your current code, try this change :
acumulator += (float)delta_time/1000.0f;
-Dave Olsen> ----- Original Message -----

From: antonmaster@mail.ru (antonmasteR)
To:
Sent: Sunday, January 22, 2006 7:05 PM
Subject: Re[2]: [SDL] fps independent animation

-----Original Message-----
From: Gabriel
To: antonmasteR , SDL Mailing List
Date: Sun, 22 Jan 2006 14:46:27 -0300
Subject: Re: [SDL] fps independent animation

what about the subj? How do i get it? Do you have any examples of it?

Simple way which works well : Speed = Speed + Accel * Time; Pos = Pos +
Speed * Time

More mathematically correct, more complex, and (slightly) better
looking : the famous Olofson’s Pig ( http://olofson.net/mixed.html ) Not
as famous as Pavlov’s Dogs or Schroedinger’s Cat but it’s getting
there :wink:

I use the first method in all of our games and it works good enough.

–Gabriel


Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel on Graphics - http://gabrielongraphics.blogspot.com

and what is the Time var??

i do this:


> >        float start_t = 0.0f;
> > float dt = 0.01f;
> >
> > float acumulator = 0.0f;
> > float curtime = 0.0f;
> > float delta_time = 0.0f;
> >
> > fps_start = SDL_GetTicks();
> >
> > curtime = SDL_GetTicks();
> >
> > int times = 0;
> >
> > while(!exit)
> > {
> > start_t = SDL_GetTicks();
> > delta_time = start_t - curtime;
> > curtime = SDL_GetTicks();
> >
> > acumulator += delta_time;
> >
> >
> > if (acumulator >= dt)
> > {
> >
> > CheckInput();
> > SDL_FillRect(screen, NULL, 0x000000);
> > ProcessCircle();
> >
> > SDL_Flip(screen);
> >
> > acumulator = 0;
> >
> > times++;
> > }
> >
> >
> > fps++;
> >
> > if ((SDL_GetTicks() - fps_start) >= 1000)
> > {
> > fps_start = SDL_GetTicks();
> > printf("fps = %d\n", fps);
> > printf("times = %d\n", times);
> > times = 0;
> > fps = 0;
> > }
> >      }

and fps and times prints the same values. whats wrong with them?
btw with any dt value the animation has the same speed :expressionless:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Is using the animation/simulation available on the internet illegal even i recognize the author? I’m working on my thesis and I’m planning to utilize the simulation/animation available on the internet to enrich my discussions. Is it plagerism even I will be recognizing the authors. My thesis adviser doesn’t agree with my plan 'cause for her it’s plagerism. I ask some of my professors and they say it is okay if i will recognize the authors. I just want to find a concrete answer. Please cite your source or basis.------------------------
old is gold

Is using the animation/simulation available on the internet illegal even i
recognize the author? I’m working on my thesis and I’m planning to utilize
the simulation/animation available on the internet to enrich my discussions.
Is it plagerism even I will be recognizing the authors. My thesis adviser
doesn’t agree with my plan 'cause for her it’s plagerism. I ask some of my
professors and they say it is okay if i will recognize the authors. I just
want to find a concrete answer. Please cite your source or basis.

There is one absolute truth I learned in graduate school: Your thesis
advisor is always right.

Do not waste time trying to change your advisers mind. For the love of
what ever you hold holy to not prove your adviser is wrong. Just do it
the way your adviser wants it done. There is no point in borrowing
pain. You’ll get enough in your life.

In grad school a friend of mine was preparing for his Ph.D oral exam
in CS. He had of course seen the statement that sorting takes O(NLog
N) and he sort of understood it, but he felt that was not a reasonable
answer so he asked the rest of us in our office what we thought of it.
I pointed out the obvious bit about how that was only true in the
general case for random ordered data on the equivalent of a Turing
machine. I then pointed out that for any fixed N you can build a
special purpose device that will sort those N items in O© time, or
in O(N) time if you include loading and unloading the device. It was
all good fun. Well, he was asked that question during his exam and he
gave the standard answer and then tossed what he had learned from our
discussion. One of the professors on his panel flunked him for adding
that extra bit of discussion. He damn near washed out because he did a
little thinking outside the box. The same professor flunked me on a
project because I turned in a design for a data flow machine when he
had expected a shared memory multiprocessor. Turns out he did not
understand data flow architectures. Pure theoretical CS jackass who
did not understand reality. That was back in the early '80s and that
idiot taught at that school until just recently when he died. (He died
young of a horrible form of cancer. Karma is a bitch.) Back to my
friend, his adviser and the other professors (5 on a Ph.D panel) were
able to get that idiot removed and replaced and they redid the guys
exam. They were able to do that because the other four were willing to
swear that the original exam was just a review and not the actual
exam. They also swore that the fifth guy had gotten the memo. If they
hadn’t been willing to lie that one idiot would have caused my friend
to wash out.

I included this story for its instructional value. I didn’t list the
number of people I know who did something to piss of their adviser who
were just dumped on the street with nothing to show for years of
graduate study.

If your adviser tells you the world is flat, try to get it in writing,
keep a careful record of his insanity, but do not contradict your
adviser.

Bob PendletonOn Tue, Dec 22, 2009 at 11:29 PM, gladysila wrote:


old is gold


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

I don’t normally reply to my own posts, but I realized that my first
response was triggered by my own traumatic experiences in graduate
school. But, I didn’t address the real question.

First off, this question iis highly off topic for this list.

Second, You are asking for a legal opinion. There are only two places
you can go for a reliable answer. 1) You can consult a certified
Intellectual Property Lawyer. 2) You can ask your college. It is
likely that your school already has a policy on this subject and they
have people whose job it is to ensure that the policy is followed. If
you ask your question of your own IP lawyer and your school and you
get different answers, as may well occur, you have no choice but to
comply with your school’s policy. In the event that your school’s
differs from your advisers policy you better do what you adviser says
to do.

Of course, since your adviser has all ready told you her policy,
asking anyone else is just a waste of time.

Last, but not least, you should never ever trust legal advise you get
off the net. The only person you can trust is a lawyer who has been
paid by you. And, you know what? I always get to lawyers opinions and
I start off by telling them the answer I want. That’s important.

Bob PendletonOn Wed, Dec 23, 2009 at 3:29 PM, Bob Pendleton <@Bob_Pendleton> wrote:

On Tue, Dec 22, 2009 at 11:29 PM, gladysila wrote:

Is using the animation/simulation available on the internet illegal even i
recognize the author? I’m working on my thesis and I’m planning to utilize
the simulation/animation available on the internet to enrich my discussions.
Is it plagerism even I will be recognizing the authors. My thesis adviser
doesn’t agree with my plan 'cause for her it’s plagerism. I ask some of my
professors and they say it is okay if i will recognize the authors. I just
want to find a concrete answer. Please cite your source or basis.

There is one absolute truth I learned in graduate school: Your thesis
advisor is always right.

Do not waste time trying to change your advisers mind. For the love of
what ever you hold holy to not prove your adviser is wrong. Just do it
the way your adviser wants it done. There is no point in borrowing
pain. You’ll get enough in your life.

In grad school a friend of mine was preparing for his Ph.D oral exam
in CS. He had of course seen the statement that sorting takes O(NLog
N) and he sort of understood it, but he felt that was not a reasonable
answer so he asked the rest of us in our office what we thought of it.
I pointed out the obvious bit about how that was only true in the
general case for random ordered data on the equivalent of a Turing
machine. I then pointed out that for any fixed N you can build a
special purpose device that will sort those N items in O© time, or
in O(N) time if you include loading and unloading the device. It was
all good fun. Well, he was asked that question during his exam and he
gave the standard answer and then tossed what he had learned from our
discussion. One of the professors on his panel flunked him for adding
that extra bit of discussion. He damn near washed out because he did a
little thinking outside the box. The same professor flunked me on a
project because I turned in a design for a data flow machine when he
had expected a shared memory multiprocessor. Turns out he did not
understand data flow architectures. Pure theoretical CS jackass who
did not understand reality. That was back in the early '80s and that
idiot taught at that school until just recently when he died. (He died
young of a horrible form of cancer. Karma is a bitch.) Back to my
friend, his adviser and the other professors (5 on a Ph.D panel) were
able to get that idiot removed and replaced and they redid the guys
exam. They were able to do that because the other four were willing to
swear that the original exam was just a review and not the actual
exam. They also swore that the fifth guy had gotten the memo. ?If they
hadn’t been willing to lie that one idiot would have caused my friend
to wash out.

I included this story for its instructional value. I didn’t list the
number of people I know who did something to piss of their adviser who
were just dumped on the street with nothing to show for years of
graduate study.

If your adviser tells you the world is flat, try to get it in writing,
keep a careful record of his insanity, but do not contradict your
adviser.

Bob Pendleton


old is gold


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------


±----------------------------------------------------------

Yeah, but you gave him, and maybe others, some good advice they may not have
been aware of. Only thing I can see that you left off is that the main
purpose of the oral dissertation is for the committee to have the opportunity
to convince you that you’re a complete idiot who hasn’t learned anything. If
you can successfully show them that just maybe they might be a little bit
wrong, they let you know by saying “Congratulations, Dr So-and-So”.

:-)On Wednesday 23 December 2009 13:38, Bob Pendleton wrote:

I don’t normally reply to my own posts, but I realized that my first
response was triggered by my own traumatic experiences in graduate
school.

I don’t normally reply to my own posts, but I realized that my first
response was triggered by my own traumatic experiences in graduate
school.

Yeah, but you gave him, and maybe others, some good advice they may not have
been aware of. Only thing I can see that you left off is that the main
purpose of the oral dissertation is for the committee to have the opportunity
to convince you that you’re a complete idiot who hasn’t learned anything. If
you can successfully show them that just maybe they might be a little bit
wrong, they let you know by saying “Congratulations, Dr So-and-So”.

:slight_smile:

Yeah, unless you are a Masters student and one of your professors
thinks you are a Ph.D student. Yep, that happened to me. Here is how
the last 10 minutes of my life as a graduate student went. I had just
finished being grilled for about 3 hours by my committee and anyone
else who wanted to drop in and ask questions. I thought it went pretty
well…

After it was over I was asked to follow my committee to the room where
they would deliberate. You are supposed to stand outside that room and
sweat until they come out and give you the news. I’ve stood with
people waiting out side that door. It rarely takes longer than 5
minutes. I’ve seen it take less than a minute. After about 45 minutes
one professor came out and from his body language I could tell that he
had bad news. Have you ever seen someone trying to stand with their
legs and arms crossed? He started asking me questions about my future
plans. Was I planning to go in to academia, or into business? Was I
planning to teach or do research? What were my long term life goals?
Finally I stopped him and asked why he was asking me all this, what
was wrong? After hemming and hawing and walking back and forth, he
said “I’m sorry, but your Ph.D thesis is not up the standards I expect
from students at this school.” I looked at him like he was nuts. I do
believe from the look on his face that he thought I was going to
attack him. I said “Ph.D? What Ph.D, I’m a Masters student?”

He looked like he had dropped the weight of the world from his
shoulders and said “What!? THAT was a MASTERS thesis?”. I
assured him it was. He then said something along the lines of “I
didn’t think anyone would do that much work for a Masters Thesis. That
is a DAMN fine masters thesis.” I can’t guarantee the accuracy of that
last part. I was experiencing tunnel vision and having trouble
standing up. He ran back into the room and before I could finish
falling over all three of my committee members were out there
congratulating me and shaking my hand and wishing me well.

The truth is that even though that fellow had sat through all the
different steps required for me to get that damn degree, even though
he signed my thesis right under where it said “Masters of Science”,
even though the fact that it was my Masters Thesis defense was written
in large letters on the white board in the room where he had just
spent hours grilling me, he thought I was a Ph.D student and he almost
flunked me because of it. If I had only answered his questions and not
specifically asked what the problem was, I would have flunked and I
may never have known why.

Your graduate committee can take away your birthday and you will be
unable to even question what happened.

Honestly, when I hear of the rare cases of graduate students going
nuts and killing their advisers I am not shocked. In fact, I am
surprised that it doesn’t happen more often.

Bob PendletonOn Wed, Dec 23, 2009 at 4:19 PM, Jeff Post <j_post at pacbell.net> wrote:

On Wednesday 23 December 2009 13:38, Bob Pendleton wrote:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------