citro3d - how to rotate 2d sprite

Discussion in '3DS - Homebrew Development and Emulators' started by Pepepuhn, Jul 13, 2017.

  1. Pepepuhn
    OP

    Pepepuhn Member

    Newcomer
    2
    Sep 30, 2013
    Germany
    Hi,
    I am trying to modify the following "gpusprites" example of devkitPro:
    https://github.com/devkitPro/3ds-examples/blob/master/graphics/gpu/gpusprites/source/main.c

    What I am trying to achieve is, I want to rotate in 2d each sprite individually..
    Can someone help me?

    Currently I am just modifying the sceneRender() function:
    Code:
    static void sceneRender(void) {
    //---------------------------------------------------------------------------------
    
        int i;
        for(i = 0; i < NUM_SPRITES; i++) {
    
            Mtx_RotateZ(&projection, 0.1f, false);
    
            // Update the uniforms
            C3D_FVUnifMtx4x4(GPU_VERTEX_SHADER, uLoc_projection, &projection);
    
            drawSprite( sprites[i].x, sprites[i].y, 32, 32, sprites[i].image);
        }
    
    }
    However it doesn't yield the desired result.
     
  2. trainboy2019

    trainboy2019 GBAtemp Advanced Fan

    Member
    4
    GBAtemp Patron
    trainboy2019 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Oct 6, 2015
    Antarctica
    Ylisse
    You should probably ask here.
     
  3. bee395

    bee395 Member

    Newcomer
    1
    Jun 26, 2016
    Netherlands
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice