about MSAShape3D

One question about MSAShape3D.

I am trying to draw a 3D mesh, which is drawed within two for instructions (x, and y axis), when I draw it with plain openGL I get a framerate of 160fps, when I use MSAShape3D, which is supposed to be faster, I get around 50 fps rate.

I have tried calling the myObject.end() function after each inner loop (drawing line by line) or creating and array of MSA::Shape3D objects, and calling end after the outer loop…however I always get very bad results.

I see no real difference with the examples I’ve seen but using an array of Shape3D objects.

Any idea about it?

I have a similar experience, if I draw using glNormal3f() and glVertex3f() I get 60fps but I change it to MSAShape3D.setNormal() and addVertex() the frame rate drops to 30, I also realise when I quit the app I get the following error messages in the console:

MetaBalls(1067,0xa0708540) malloc: *** error for object 0x10e9c00: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Any help will be much appreciated!

  • rS

It always happens, I post and soon after I fix the problem.

So I manage to improve the performace by reading this post http://forum.openframeworks.cc/t/ofxmsashape3d/1898/4 there Memo explains how to get better performance out the class, I quote “if safe mode is off, it runs faster, but you better know exactly what states are on or off, and how you want them!”

So all I did was, in my class constructor:

mShape.reserve( 5000 );  
mShape.setSafeMode( false );  

and in the class display method:

mShape.enableColor( false );  
mShape.enableNormal( true );  
mShape.enableTexCoord( false );  
mShape.begin( GL_TRIANGLES );  
	for ( int i = 0; i < numTriangles; i++ ) {  
		mShape.setNormal( ... );  
		mShape.addVertex( ... );  

But the memory errors persist …


With mShape.setSafeMode( false ) is faster, but not as fast as with plain OpenGL.

However, the colours and shadows are strange.
Any advice?