Next Meeting: July 7: Social gathering Next Installfest: TBD Latest News: Jun. 14: June LUGOD meeting cancelled Page last updated: 2004 May 13 02:47
 The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers. Report this post as spam: (Enter your email address)
Re: [vox-tech] Success with fltk and SDL_image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

# Re: [vox-tech] Success with fltk and SDL_image

```On Wed 12 May 04,  1:47 PM, Bill Kendrick <nbs@sonic.net> said:
> On Wed, May 12, 2004 at 01:36:23PM -0700, Peter Jay Salzman wrote:
> > Even for pi/2 rotations, it takes a little trig.   :-)
>
> Hrm?
>
> Nah!
>
> for (y = height - 1; y >= 0; y--)
> {
>   for (x = width - 1; x >= 0; x++)
>   {
>     src_x = width - x - 1;
>     src_y = height - y - 1;
>
>     ... copy pixel from src surface @ (src_x,src_y) to
>         dest surface @ (x,y)
>   }
> }
>
> ;^)
>
> Or am I totally confused?

not confused.  most people don't think about math too deeply.

every rotation by pi/2, no matter what algorithm you use, is a special
case of a more general method of rotation.

remember the basic identities: sin(pi/2) = 1 and cos(pi/2) = 0.  don't
be surprised if a lot of ones and zeros enter whatever algorithm you
choose, as opposed to numbers like .7071 and .3333.

you may THINK trig has nothing to do with it.  but that's just because
you haven't peeked under the hood!

> > therefore, a rotation in 2-space only has a single degree of freedom yet
> > the rotation tensor has 4 components.  a rotation in 3-space has 6
> > degrees of freedom yet the tensor has 9 components.
> >
> > this means your rotations are inefficient if you chose this method to
> > rotate pixels, since you're carrying around a lot of extra baggage in
> > your calculations.
> >
> > if you do a google search on "rotation quaternions" you'll find a much
> > more efficient routine for rotations at the price of being much more
> > abstract.
>
> Well now I >am< totally confused! ;)
>
> -bill!

i was once told that the military uses quaternionic rotations in mission
critical applications.  not sure if the person was talking out the side
of their butt or not.  but it sure sounds impressive!   :-)

pete

--
Make everything as simple as possible, but no simpler.  -- Albert Einstein
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech

```

 LUGOD Group on LinkedIn Sign up for LUGOD event announcements Your email address: LUGOD Group on Facebook 'Like' LUGOD on Facebook:

 Hosting provided by: Sunset Systems Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development. LUGOD: Linux Users' Group of Davis PO Box 2082, Davis, CA 95617 Contact Us LUGOD is a 501(c)7 non-profit organization based in Davis, California and serving the Sacramento area. "Linux" is a trademark of Linus Torvalds. Sponsored in part by: For numerous book donations.