Is there a 3D version of ofVertex?

Hi,

I guess not but I will ask just in case, Is it possible to use ofVertex to draw a 3D polygon?

I check the reference and there is no ofVertex(x, y, z) version is there a 3D equivalent?

Cheers
rS

Hi,

you can do this a few ways. most efficient is to use memo’s excellent MSAShape3D, which you can get here (along with his other libs):
http://github.com/memo/msalibs

You can also do it with straight openGL, like this:

  
  
//fill with a color  
ofSetColor( 255, 10, 10);  
  
glBegin(GL_POLYGON);  
//draw your vertices  
glVertex3f( 1, 1, 1);  
glVertex3f( 5, 10, 20);  
glVertex3f( 10, 15, 25);  
glVertex3f( 5, 30, 30);  
glVertex3f( 1, 1, 1); // and so on  
glEnd();  
  

(more about glBegin / glEnd here: http://www.opengl.org/sdk/docs/man/xhtml/glBegin.xml)

MSAShape3D is much faster, though.

Yes MSAShape3D I use it previously, just wondering if it could be done with native OF methods

Cheers
rS

One question about MSAShape3D.

I am trying to draw a 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 a 40 fps rate.

I have tried calling the 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 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?
Thanks.

Hi ofPak,

Very interesting situation you got there, may I recommend to create a new post regarding your problem, because is going to be difficult to get proper support from this post, I am very interested to know why and how can be fix.

Cheers
rS

[quote author=“nardove”]Hi ofPak,

Very interesting situation you got there, may I recommend to create a new post regarding your problem, because is going to be difficult to get proper support from this post, I am very interested to know why and how can be fix.

Cheers
rS[/quote]

There you got it!!

http://forum.openframeworks.cc/t/about-msashape3d/4950/0