Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

3dprimitive.setPosition() not applying when doing 3dprimitive.getMesh()

$
0
0

@jpericas22 wrote:

Hi,

Just started exporting a group of ofBoxPrimitive with different positions to an ofMesh

Couldnt get it working by setting the position of the primitive by using the class function setPosition(), but found a workaround in the forum that works for me.

link to the forum thread: Workaround on last post

Why does this workaround work on setting the positions while the class function does nothing?

ej:

//this works
for(int i = 0; i < primitiveCube.getMesh().getVertices().size(); i++){
        primitiveCube.getMesh().getVertices()[i] += ofVec3f( x*separation ,
                                                            y*separation ,
                                                            fin_s / 2.0
                                                          );
    }

//this doesnt work
primitiveCube.setPosition( x*separation ,
                               y*separation ,
                               fin_s / 2.0
                             );

return primitiveCube.getMesh();

Sorry in advance if this is not a bug, just thought this was some extrange behavior that could be fixed.

Thanks

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles