Quick Question about animation

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Thanks in advanced for any suggestions giving.
-Lamonte–
Join phpdiscovery.com Now!

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Unfortunately (as I’m sure many have discovered and I am currently
discovering), there’s no “best” way to do something like this. You
could set a variable and draw one or the other image based on that
variable’s value (meaning one more if() statement each frame), or you
could set some pointer variable to a drawing structure to point to a
different image each time it needs to switch… Those are the only
two reasonable ones I can come up with. The others a far more
obscure and unlikely.

Do either of those help at all?

I think a lot of “best” depends on how you’re structuring your
entities, also.

– ScottOn Mar 7, 2007, at 3:33 PM, Lamonte(Scheols/Demonic) wrote:

I’m not sure if this is the best way to go, but I think this might
work anyone agree disagree?

void int manOne(){
return 2;
}
void int manTwo(){
return 3;
}
void int spriteRUN(){
if(manOne() == 2){
//call sprite

//change sprite possition
	manTwo();
}else if(manTwo == 3){
//call sprite
	
//change sprite possition
	manOne();
}

}On 3/7/07, Scott Harper wrote:

On Mar 7, 2007, at 3:33 PM, Lamonte(Scheols/Demonic) wrote:

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Unfortunately (as I’m sure many have discovered and I am currently
discovering), there’s no “best” way to do something like this. You
could set a variable and draw one or the other image based on that
variable’s value (meaning one more if() statement each frame), or you
could set some pointer variable to a drawing structure to point to a
different image each time it needs to switch… Those are the only
two reasonable ones I can come up with. The others a far more
obscure and unlikely.

Do either of those help at all?

I think a lot of “best” depends on how you’re structuring your
entities, also.

– Scott


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


Join phpdiscovery.com Now!

How about drawing the first image, displaying it for a small amount of
time. Draw the second image, display it for a small amount of time.
Repeat until done?

Your question is very difficult to answer. The way you stated the
question implies that there exists a “best” way to do what you want and
that everyone reading the question knows what you mean by “best”. There
isn’t and we don’t. Trying to find the “best” way is a never ending
quest because it doesn’t exist. If you want to get the job done look for
a way that works and be happy with it.

	Bob Pendleton

P.S.

If you have a negative emotional reaction to what I just said. Count to
1024 in binary on your fingers and then think about what I said. It was
not said to insult or injure but to help you avoid the most horrible
pitfall of programming. A trap I spent many years in before I realized
that the word “best” has no universal meaning.On Wed, 2007-03-07 at 16:33 -0600, Lamonte(Scheols/Demonic) wrote:

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Thanks in advanced for any suggestions giving.
-Lamonte


±-------------------------------------+

Yo bob did you see my example i had yet? When I said best I ment like
best in your opinion theres no such thing as best imo anyways ;).On 3/7/07, Bob Pendleton wrote:

On Wed, 2007-03-07 at 16:33 -0600, Lamonte(Scheols/Demonic) wrote:

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Thanks in advanced for any suggestions giving.
-Lamonte

How about drawing the first image, displaying it for a small amount of
time. Draw the second image, display it for a small amount of time.
Repeat until done?

Your question is very difficult to answer. The way you stated the
question implies that there exists a “best” way to do what you want and
that everyone reading the question knows what you mean by “best”. There
isn’t and we don’t. Trying to find the “best” way is a never ending
quest because it doesn’t exist. If you want to get the job done look for
a way that works and be happy with it.

            Bob Pendleton

P.S.

If you have a negative emotional reaction to what I just said. Count to
1024 in binary on your fingers and then think about what I said. It was
not said to insult or injure but to help you avoid the most horrible
pitfall of programming. A trap I spent many years in before I realized
that the word “best” has no universal meaning.


±-------------------------------------+


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


Join phpdiscovery.com Now!

I’m not sure if this is the best way to go, but I think this might
work anyone agree disagree?

I was thinking something a bit more along the lines of (forgive the
pseudo-code, I haven’t written C in a little while):

struct {
Sprite[] sprites;
int currentSprite;
int numberOfSprites;
val timeBetweenFrames;
} thing;

void spriteDraw() {
val currentTime = getTime();
if( currentTime > thing.timeBetweenFrames ) {
thing.currentSprite += 1;
if( thing.currentSprite >= thing.numberOfSprites )
thing.currentSprite = 0;
}

draw( thing.currentSprite );

}

The loop you wrote would, it seems always draw manOne…?

Another way might be:

Sprite getActiveSprite() {
return activeSprite;
}

void process() {
//change sprite if need be
}

void draw() {
getActiveSprite().draw();
}

As you can probably tell, I really like to process EVERYTHING then
draw EVERYTHING. ^^ I’m sorry if my pseudocode seems weird, I’ve
been working in Java lately, and don’t remember exactly how the
differences between the two work… <
< It seems like your way
probably works as you envision it in your head, though. I’d say give
it a shot if that’s what you’re comfortable with! :slight_smile: That’s what I
do! Though I also tend to rewrite when I discover a way that works
better for me. But then, I doubt if anyone could have explained it
to me beforehand to avoid the rewrite…

Sorry if I’m being vague.

– ScottOn Mar 7, 2007, at 4:17 PM, Lamonte(Scheols/Demonic) wrote:

void int manOne(){
return 2;
}
void int manTwo(){
return 3;
}
void int spriteRUN(){
if(manOne() == 2){
//call sprite

//change sprite possition
manTwo();
}else if(manTwo == 3){
//call sprite

//change sprite possition
manOne();
}
}

On 3/7/07, Scott Harper wrote:

On Mar 7, 2007, at 3:33 PM, Lamonte(Scheols/Demonic) wrote:

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot
forward
so if I would to keep running the frames back and forth it would
look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Unfortunately (as I’m sure many have discovered and I am currently
discovering), there’s no “best” way to do something like this. You
could set a variable and draw one or the other image based on that
variable’s value (meaning one more if() statement each frame), or you
could set some pointer variable to a drawing structure to point to a
different image each time it needs to switch… Those are the only
two reasonable ones I can come up with. The others a far more
obscure and unlikely.

Do either of those help at all?

I think a lot of “best” depends on how you’re structuring your
entities, also.

– Scott


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


Join phpdiscovery.com Now!


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

Simple enough. Load the two images. Have code to switch between a pointer
to the first image and the second image.

Normally you write a simple “Prop” or “Anim” type class that can load a
number of “frames” of animation (images) and sequence between them. Typical
implementations support animation forward to end, forward and repeat,
backward to beginning, backward and repeat. Stopped (on a particular frame),
etc.

If you want I can give you some code for this, but it really is very
straight forward to write. 95% of the fun is in writing the routine and
learning how to do it. :slight_smile:

Ken Rogoway
Homebrew Software
http://www.homebrewsoftware.com/> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Lamonte(Scheols/Demonic)
Sent: Wednesday, March 07, 2007 4:33 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: [SDL] Quick Question about animation.

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Thanks in advanced for any suggestions giving.
-Lamonte


Join phpdiscovery.com Now!


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


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 3/7/2007
9:24 AM


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 3/7/2007
9:24 AM

Sorry for the earlier post. I didn’t see all of the responses. If they
didn’t help (and it looks like they should have) then let me know and I can
send you a routine to handle animated images.

Ken Rogoway
Homebrew Software
http://www.homebrewsoftware.com/> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Ken Rogoway
Sent: Wednesday, March 07, 2007 11:36 PM
To: 'A list for developers using the SDL library. (includes SDL-announce)'
Subject: Re: [SDL] Quick Question about animation.

Simple enough. Load the two images. Have code to switch between a pointer
to the first image and the second image.

Normally you write a simple “Prop” or “Anim” type class that can load a
number of “frames” of animation (images) and sequence between them. Typical
implementations support animation forward to end, forward and repeat,
backward to beginning, backward and repeat. Stopped (on a particular frame),
etc.

If you want I can give you some code for this, but it really is very
straight forward to write. 95% of the fun is in writing the routine and
learning how to do it. :slight_smile:

Ken Rogoway
Homebrew Software
http://www.homebrewsoftware.com/

-----Original Message-----
From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Lamonte(Scheols/Demonic)
Sent: Wednesday, March 07, 2007 4:33 PM
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: [SDL] Quick Question about animation.

Hello,
I was wondering whats the best way to switch between 2 image frames
every time I would press a key. For example, If I loaded 2 bitmaps
one will have its foot back and the other would have its foot forward
so if I would to keep running the frames back and forth it would look
like my sprite was walking. Any suggestions on the BEST way to do
this?

Thanks in advanced for any suggestions giving.
-Lamonte


Join phpdiscovery.com Now!


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


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 3/7/2007
9:24 AM


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 3/7/2007
9:24 AM


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


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 3/7/2007
9:24 AM


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.7/713 - Release Date: 3/7/2007
9:24 AM

Lamonte(Scheols/Demonic) wrote:

I was wondering whats the best way to switch between 2 image frames
every time I would press a key.
Thanks in advanced for any suggestions giving.

Just in case you want a “steady” animation in all cases - a better way
than the usual “spritenum++” would be to use some math to determine the
sequence number based on the the actual time (i.e. what the player
experiences). That way, if your rendering loop slows down, the
animations will look more uniform. You might then build a control
interface for the animation using an “update rate” in Hz. i.e.
animation_seq=((animation_seq+((time_now-time_last_frame)*rate)%num_sprites)

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the source
rectangle coordinates to get the appropriate graphics for the current
sequence. i.e. source_x=sprite_wanimation_seq. I am not sure what a
good tool to assemble such a filmstrip would be though … but there are
batch tools to “append” images such as ImageMagick where you can do
stuff like "convert source/
+append filmstrip.png".

-------------- next part --------------
A non-text attachment was scrubbed…
Name: aschiffler.vcf
Type: text/x-vcard
Size: 135 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070308/e4c5304a/attachment.vcf

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the
source rectangle coordinates to get the appropriate graphics for
the current sequence. i.e. source_x=sprite_wanimation_seq. I am
not sure what a good tool to assemble such a filmstrip would be
though … but there are batch tools to “append” images such as
ImageMagick where you can do stuff like "convert source/
+append
filmstrip.png".

We do use this technique, but with opengl. Be build the texture when
the programme init. Like:

  • Init a big texture
  • Load all files inside the texture, with opengl sub texture upload
    functions it’s easy, but you have a different scenario.

You can also assemble the image with image magick or any tool like
that, but we prefered our way.

We use this to draw precalculated fonts. It’s a lot faster to have
one 1024 1024 texture that having 200 littles textures. But it’s
ideal for sprite animation, as you can do (in opengl, again adapt to
your scenario):
glTexCoord(spriteOffset * spriteWidth, spriteOffset + 1 * spriteWidth);

It’s easy and very efficient.

RegardsOn Mar 9, 2007, at 6:35 AM, Andreas Schiffler wrote:


Kuon from japan.

“Your computer requests another OS, deny or allow?”

Blog:
http://arkhi.goyman.com/blojsom/blog/default/

Alright coool I’ll work on learning openGL to :).On 3/9/07, Nicolas Goy - ??? - Goyman.com SA wrote:

On Mar 9, 2007, at 6:35 AM, Andreas Schiffler wrote:

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the
source rectangle coordinates to get the appropriate graphics for
the current sequence. i.e. source_x=sprite_wanimation_seq. I am
not sure what a good tool to assemble such a filmstrip would be
though … but there are batch tools to “append” images such as
ImageMagick where you can do stuff like "convert source/
+append
filmstrip.png".

We do use this technique, but with opengl. Be build the texture when
the programme init. Like:

  • Init a big texture
  • Load all files inside the texture, with opengl sub texture upload
    functions it’s easy, but you have a different scenario.

You can also assemble the image with image magick or any tool like
that, but we prefered our way.

We use this to draw precalculated fonts. It’s a lot faster to have
one 1024 1024 texture that having 200 littles textures. But it’s
ideal for sprite animation, as you can do (in opengl, again adapt to
your scenario):
glTexCoord(spriteOffset * spriteWidth, spriteOffset + 1 * spriteWidth);

It’s easy and very efficient.

Regards


Kuon from japan.

“Your computer requests another OS, deny or allow?”

Blog:
http://arkhi.goyman.com/blojsom/blog/default/


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


Join phpdiscovery.com Now!

Alright coool I’ll work on learning openGL to :).

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the
source rectangle coordinates to get the appropriate graphics for
the current sequence. i.e. source_x=sprite_wanimation_seq. I am
not sure what a good tool to assemble such a filmstrip would be
though … but there are batch tools to “append” images such as
ImageMagick where you can do stuff like "convert source/
+append
filmstrip.png".

We do use this technique, but with opengl. Be build the texture when
the programme init. Like:

  • Init a big texture
  • Load all files inside the texture, with opengl sub texture upload
    functions it’s easy, but you have a different scenario.

You can also assemble the image with image magick or any tool like
that, but we prefered our way.

We use this to draw precalculated fonts. It’s a lot faster to have
one 1024 1024 texture that having 200 littles textures. But it’s
ideal for sprite animation, as you can do (in opengl, again adapt to
your scenario):
glTexCoord(spriteOffset * spriteWidth, spriteOffset + 1 * spriteWidth);

It’s easy and very efficient.

Regards


Kuon from japan.

“Your computer requests another OS, deny or allow?”

Blog:
http://arkhi.goyman.com/blojsom/blog/default/


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


Join phpdiscovery.com Now!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.orgOn Fri, Mar 09, 2007 at 08:07:19AM -0600, Lamonte(Scheols/Demonic) wrote:
On 3/9/07, Nicolas Goy - ?$B;~4|@:Nn - Goyman.com SA wrote:

On Mar 9, 2007, at 6:35 AM, Andreas Schiffler wrote:

Hi!

Sorry that I reanimate this topic again, but…

Andreas Schiffler schrieb:

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the source
rectangle coordinates to get the appropriate graphics for the current
sequence. i.e. source_x=sprite_w*animation_seq.

… I don’t understand why this is a common approach:

I’ve done several tests and each time this “clipping method” was up to two times
slower (even with small frames sizes of 10 x 10 pixels) compared to an array,
storing a single surface for each frame.

So, when exactly are “filmstrips” really faster?

Thanks,

Tim

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the
source
rectangle coordinates to get the appropriate graphics for the current
sequence. i.e. source_x=sprite_w*animation_seq.

… I don’t understand why this is a common approach:

I’ve done several tests and each time this “clipping method” was up
to two times
slower (even with small frames sizes of 10 x 10 pixels) compared
to an array,
storing a single surface for each frame.

So, when exactly are “filmstrips” really faster?

Here’s a question: were you calculating the offset each frame it was
drawn, or did you store the coordinates in variables (perhaps an
array)? It seems to make sense that the former would be slower, but
perhaps not the latter.

Of course, I don’t imagine this method would be FASTER ever, just
perhaps more space-efficient on either the video card or your hard
drive/ In any case, it’s fewer files to load, which you may or may
not care about. As for me, I would rather have a few 256x256
tilemaps than dozens of 32x32 ones, if only because it makes it
easier to know what’s what when browsing the filesystem by hand, and
I can write an algorithm to break up the larger maps into smaller
tiles based on, well, an number of things. :slight_smile:

What’s your take on the convenience of many small files versus few
large ones?

– Scott

You could also just store it as a strip in the files and then have your
program cut them into strips when the game starts. My method isn’t very
efficient, but it only affects game load time, and usually game load time
doesn’t matter too much. Just remember, if you do it this way, don’t forget
to free the original file.On 3/10/07, Scott Harper wrote:

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the
source
rectangle coordinates to get the appropriate graphics for the current
sequence. i.e. source_x=sprite_w*animation_seq.

… I don’t understand why this is a common approach:

I’ve done several tests and each time this “clipping method” was up
to two times
slower (even with small frames sizes of 10 x 10 pixels) compared
to an array,
storing a single surface for each frame.

So, when exactly are “filmstrips” really faster?

Here’s a question: were you calculating the offset each frame it was
drawn, or did you store the coordinates in variables (perhaps an
array)? It seems to make sense that the former would be slower, but
perhaps not the latter.

Of course, I don’t imagine this method would be FASTER ever, just
perhaps more space-efficient on either the video card or your hard
drive/ In any case, it’s fewer files to load, which you may or may
not care about. As for me, I would rather have a few 256x256
tilemaps than dozens of 32x32 ones, if only because it makes it
easier to know what’s what when browsing the filesystem by hand, and
I can write an algorithm to break up the larger maps into smaller
tiles based on, well, an number of things. :slight_smile:

What’s your take on the convenience of many small files versus few
large ones?

– Scott


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

You could also just store it as a strip in the files and then have
your program cut them into strips when the game starts. My method
isn’t very efficient, but it only affects game load time, and
usually game load time doesn’t matter too much. Just remember, if
you do it this way, don’t forget to free the original file.

I’m actually using OpenGL for all of my drawing, and while I haven’t
done a test yet for speed using the filmstrip versus separate images
I don’t imagine the difference being that great, since regardless of
your method the video card is going to do the same interpolation
across a surface. That’s one area where OpenGL shines is how
flexible it allows you to be. I imagine that if I were to have
dozens of smaller files it would probably also cause more memory
issues sooner, as one may no necessarily want power-of-2 textures for
all one’s sprites. :slight_smile:

– ScottOn Mar 10, 2007, at 10:49 AM, Patrick Mohr wrote:

So, when exactly are “filmstrips” really faster?

They are not faster do draw - they are faster to load, easier to manage
and compact in the source-code.

Something to keep in mind with the filmstrip approach is byte-alignment
… todays CPU’s (or rather the memory subsystems) love power of two
margins for memcpy type blitting (or any memory access really). So if
one is blitting non-32bit surfaces, it is very easy to mismatch these
32bit or 64bit boundaries (imagine a 8bit texture with 7x13 sized tiles,
one would seldom read or write on a 64bit boundary). When we have memory
accesses on misaligned boundaries, we are slowing down everything.

The SDL surface allocator likely optimizes this (that’s why there is a
row byte-length which is often different from the
width-times-bytes-per-pixel number) making the array-of-surfaces method
faster than the filmstrip-method.

But if one keeps the filmstrip tiles properly boundary-byte-aligned, the
overhead for subselecting parts of a larger ‘filmstrip’ when blitting
should not be very significant and the speed can be assumed comparable
to the array-of-surfaces method.

So as a rule of thumb: for maximum speed, stick your tiles on 8byte
boundaries (i.e. 8n x 8n tiles for 8bit surfaces, 2n x 2n tiles for
32bit surfaces.

But as people mention here on the list, using on-memory blit-style
compositing - the SDL hallmark - is becoming less and less important in
graphics programming because 3D hardware can be assumed to be present
(as in people use Linux’s compiz/beryl/metisse, Vista’s Aero, OSX’s
Quartz Extreme) and blit operations are essentially “free” on a 3D
cards to execute once the texture has been setup. For fonts for example
one can use OpenGL’s alpha-channel-only texture modes and render some
128 good looking character into 64x128 tiles using 1MB of texture
memory. The tile selection is then done purely by programming the
texture coordinates - similarly to the filmstrip approach discussed here.

And one can take use of the motion blur effects etc, with OpenGL.
This will make fast animations look more natural to human eye.On Friday 09 March 2007 09:27, Nicolas Goy - ??? - Goyman.com SA wrote:

On Mar 9, 2007, at 6:35 AM, Andreas Schiffler wrote:

Also for animations with large numbers of sprites, it might be much
faster to load a single “filmstrip” surface and then change the
source rectangle coordinates to get the appropriate graphics for
the current sequence. i.e. source_x=sprite_wanimation_seq. I am
not sure what a good tool to assemble such a filmstrip would be
though … but there are batch tools to “append” images such as
ImageMagick where you can do stuff like "convert source/
+append
filmstrip.png".

We do use this technique, but with opengl. Be build the texture when
the programme init. Like:

  • Init a big texture
  • Load all files inside the texture, with opengl sub texture upload
    functions it’s easy, but you have a different scenario.

You can also assemble the image with image magick or any tool like
that, but we prefered our way.

We use this to draw precalculated fonts. It’s a lot faster to have
one 1024 1024 texture that having 200 littles textures. But it’s
ideal for sprite animation, as you can do (in opengl, again adapt to
your scenario):
glTexCoord(spriteOffset * spriteWidth, spriteOffset + 1 *
spriteWidth);

And one can take use of the motion blur effects etc, with OpenGL.
This will make fast animations look more natural to human eye.

Yes. If I remember correctly, there are some example of blur effects
in the red book.On Mar 17, 2007, at 6:26 PM, Sami N??t?nen wrote:


Kuon

“Your computer requests another OS, deny or allow?”

Blog:
http://arkhi.goyman.com/blojsom/blog/default/

El Lunes, 19 de Marzo de 2007 22:02, Kuon - Nicolas Goy - ??? (Goyman.com
SA) - 675 escribi?:

Yes. If I remember correctly, there are some example of blur effects ?
in the red book.

But IIRC those effects where implemented with the OpenGL accumulation buffer,
a feature commonly not available on usual graphic cards, so you’ll have a
big performance penalty as the rendering will be done in software.

Alberto