processing/processing4

rotate a texture in PShape bug not but work not

Open

#621 opened on Dec 9, 2022

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Java (176 forks)auto 404
help wantedopengl

Repository metrics

Stars
 (439 stars)
PR merge metrics
 (PR metrics pending)

Description

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

Contributor guide