[jugglemaster] Dynamic scaling?
Per Johan Groland
curwenx at gmail.com
Wed Sep 6 23:13:03 EDT 2006
On 9/6/06, Chunky Kibbles <chunky at icculus.org> wrote:
> What I'm looking for is kind of a normalised pattern, where the hands are
> always moving over the same area, and the height of the balls just goes
> up as there are more of them. The head would *always* be in the same
> place and the same size.
> I guess the simplest way to look at it is this; currently, I have a
> little guy in a 3d world. I can't just scale the pattern and slap it in
> front of him - and I'm lazy, and want to be able to :-)
Well, scaling the pattern so that the head is always the same size is easy.
Just keep the internal window size constant and calculate the x and y scaling
factor required to resize the head to your required dimensions. To keep the
head in a constant position, just calculate a x and y offset based on the
position of the head after scaling. Making the center of the head (0,0) sounds
I had to make several adjustments to the jmlib coordinates for the OpenGL
port I'm working on. Currently, this is all inside the opengl_renderer.cpp
file, in the function DoCoordTranform. Once I finalize how I want the
coordinates to be, I'll move everything to the Juggler class.
The Juggler class would support turning different types of transformations
on and off, such as "flip y axis," "keep head size constant," "set origin
to center of head," "set origin to middle of screen," "scale x by this factor,"
"scale y by this factor" etc etc...
I have no idea when I'll have enough free time to do this though :)
More information about the Jugglemaster