Skip to content

bug-fix: ofxFlashMatrix set_y_scale had the sin positive.#4

Open
jesusgollonet wants to merge 1 commit intojulapy:masterfrom
jesusgollonet:flash-matrix-fix
Open

bug-fix: ofxFlashMatrix set_y_scale had the sin positive.#4
jesusgollonet wants to merge 1 commit intojulapy:masterfrom
jesusgollonet:flash-matrix-fix

Conversation

@jesusgollonet
Copy link

problem: rotating a sprite while altering its height gave weird transformation problems. width was fine

to test

.h
ofxFlashSprite * sprite1;
...
.cpp
void testApp::setup() {
    sprite1 = new ofxFlashSprite();
    ofxFlashShape * s = new ofxFlashShape();
    s->setRectangle(-50, -50, 100, 100);
    s->setFill(true);
    sprite1->addChild(s);
    stage->addChild(sprite1);
}
....
void testApp::update(){

    // sprite1->width(100+ ofGetFrameNum() *.001f);     // this works fine
    sprite1->height(100+ ofGetFrameNum() *.001f); // this gives a weird transformation on the rotation
    sprite1->rotation(ofGetFrameNum()*.01f);
}

with the fix we get the expected result, a box that is growing vertically and rotates at the same time

the problem was that in set_y_scale, setC wasn't using the sin as negative.

…ght and rotating at the same time gave weird transformation problems
@julapy
Copy link
Owner

julapy commented May 3, 2012

nice find.
when i have a spare minutes i'll test this with the existing examples just to make sure it doesn't alter any other behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants