Translate RShape in a class
in
Contributed Library Questions
•
9 months ago
Hello, I have a problem with an RShape in a class that drive me crazy.
Thanks in advance.
- class Pied {
float type;
float positionX;
float positionY;
float rotation;
float echelle;
RShape theSVG;
Pied(float leType, RShape leSVG, float posX, float posY, float rota, float echel) {
positionX = posX;
positionY = posY;
rotation = rota;
echelle = echel;
type = leType;
theSVG = leSVG;
}
void display() {
pushMatrix();
translate(positionX, positionY); // with translation, it's OK
theSVG.translate(0, 0);
theSVG.rotate(rotation); // ok, rotate with no error
theSVG.scale(echelle); // ok, scale with no error
theSVG.draw();
popMatrix();
}
}
- void display() {
pushMatrix();
theSVG.translate(positionX, positionY); // no translation.
theSVG.rotate(rotation); // ok, rotate with no error
theSVG.scale(echelle); // ok, scale with no error
theSVG.draw();
popMatrix();
}
Thanks in advance.
1