Rotozoomanim

Previous topic - Next topic

AndyH

Hi Gernot

You mentioned that ROTOZOOMANIM (when it's complete) will probably use POLYVECTOR's to draw the animation frame at the size and rotation on screen.  If so, could you add an extra parameter for the color.  I'm using PolyVector to draw sprites and use the same color paramater for each of the four corners to allow me to tint the sprite in any colour I want (or RGB 255,255,255 to leave unchanged).

This would be extremely handy and powerful if the ROTOZOOMANIM command could do this too!

AndyH

Thanks a million for the new anim commands :)

Wonder if you are still able to do anything about the color part though?  (I'm never content am I ;))

I'm wondering, if it's too late to add the colour parameter to this command, would it be possible to add a new global command such as ALPHAMODE but for the colour - eg: a new command called SETCOLOR or COLORMODE or COLORMASK.   The default value is RGB(255,255,255) which will make all sprite, anim and PRINT commands display everything normal colour.

If you SETCOLOR to RGB(255,0,0) then it tints sprite, anim and PRINT output red.  It would allow us to develop a game where we can tint the screen for environment effects, tint sprites for impact hits, or best of all PRINT text in red.  This would save a lot of memory and add flexibility - especially for fonts as you'd want to print them to different colours.

I'm using a modified version of that RotoZoomPoly code snippet (see below) to display a sprite with colouring.  I'm hoping that the OpenGL routines would allow you to do this quite easily for the current commandset, I wonder if the non-GL platforms such as PocketPC etc might be able to do it with out much alteration too?

Code (glbasic) Select
FUNCTION _oRotoZoomPoly: _spr, _id, _x,_y, _angle, _scale, _col
LOCAL sphi, cphi, spx, spy, dx, dy
LOCAL c=RGB(255,255,255)

    sphi=SIN(_angle)
    cphi=COS(_angle)
    //GETSPRITESIZE sprid, spx, spy
    spx = oSprites[_spr].w
    spy = oSprites[_spr].h
    dx=spx*_scale
    dy=spy*_scale


    // make it act like ROTOZOOMSPRITE
    // if you remove this line, x+y are
    // the center of the rotation
    INC _x, spx/2; INC _y, spy/2

    STARTPOLY _id
    POLYVECTOR _x- cphi*dx-sphi*dy, _y-cphi*dy+sphi*dx, 0,0, _col
    POLYVECTOR _x- cphi*dx+sphi*dy, _y+cphi*dy+sphi*dx, 0,spy, _col
    POLYVECTOR _x+ cphi*dx+sphi*dy, _y+cphi*dy-sphi*dx, spx,spy, _col
    POLYVECTOR _x+ cphi*dx-sphi*dy, _y-cphi*dy-sphi*dx, spx,0, _col
    ENDPOLY
ENDFUNCTION
The above code is part of a sprite manager I've put together with BlitzMax like commands I mentioned in another post.  I'll upload it once it's done (will add in the ROTOZOOMANIM support next).

Is this possible to add?

Kitty Hello

Thanks for sharing.
The Color thingy is very easy to implement on OpenGL. However GP2X and PocketPC really cause trouble here. I see if it's possible, but I suggest using POLYVECTOR so far, which is why I implemented it in the first place.