@miyamonz wrote:
Hello.
I may found ofNode bug.
Is this a bug? Or am I misunderstanding something?
↓press space bar
class ofApp : public ofBaseApp { ofEasyCam cam; array<ofNode, 8> nodes; public: void setup(){ for(int i=0; i<8; i++) { int x = i%2; int y = i/2 %2; int z = i/2 /2; ofPoint p(x,y,z); // (0,0,0), (0,0,1), (0,1,0), (0,1,1), ... p -= 0.5; p *= 2; // (-1,-1,-1), (-1,-1,1), (-1,1,-1), (-1,1,1), ... nodes[i].setScale(p); nodes[i].setPosition(p * 50); } } void update() { } void draw(){ cam.begin(); ofDrawAxis(300); for(auto& n : nodes) { n.draw(); ofDrawArrow(n.getPosition(), n.getPosition() + n.getScale()*100, 10); } cam.end(); } void keyPressed(int key ) { if(key == ' ') { for(auto& n : nodes) { auto m = n.getLocalTransformMatrix(); ofPoint scale0 = n.getScale(); n.setTransformMatrix(m); ofPoint scale1 = n.getScale(); if(scale0 != scale1) { ofLog() << "scale changed " << scale0 << " : " << scale1; } } } } };↓log
[notice ] scale changed 1, -1, -1 : 1, 1, 1 [notice ] scale changed -1, 1, -1 : 1, 1, 1 [notice ] scale changed 1, 1, -1 : -1, -1, -1 [notice ] scale changed -1, -1, 1 : 1, 1, 1 [notice ] scale changed 1, -1, 1 : -1, -1, -1 [notice ] scale changed -1, 1, 1 : -1, -1, -1P.S.
of_0.9.2 osx
Posts: 5
Participants: 3

