processing/processing4

rotate a texture in PShape bug not but work not

Open

#621 aperta il 9 dic 2022

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Java (176 fork)auto 404
help wantedopengl

Metriche repository

Star
 (439 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Created by: matheplica

Hi, here's a bug with last Processing version :

PMatrix2D uvtr = new PMatrix2D();
textUVA = new PVector(0, 0.5);
        textUVB = new PVector(0.25, 0.08);
        memUVA = new PVector(0, 0.5);
        memUVB = new PVector(0.25, 0.08);

void adaptTexture(){
       uvtr.reset();
        uvtr.translate(0.5, 0.5);
        uvtr.rotate(rotText);
        uvtr.translate(-0.5, -0.5);
        uvtr.mult(memUVA, textUVA);
        uvtr.mult(memUVB, textUVB);
        sh.setTextureUV(1, textUVA.x, textUVA.y);
        sh.setTextureUV(2, textUVB.x, textUVB.y);
}

Before I start to change the variable rotText like this:

ani = new Ani(this, time, "rotText", rotText+((PI/3)*sens), Ani.CIRC_OUT, "onUpdate:adaptTexture");

This part of code runs in P3 but not in P4. There is no error message but it's append nothing. In P3 the texture turn in the shape.

I'm on ubuntu 22.04

Guida contributor