Hi, i need to convert the following code into VAR to get better performaces:
</font><blockquote><font size=“1” face=“Verdana, Arial”>code:</font><hr /><pre style=“font-size:x-small; font-family: monospace;”>
for (i=0; i<o->nPlanes;i++)
{
if (o->planes[i].visible)
for (j=0;j<3;j++)
{
k = o->planes[i].neigh[j];
if ((!k)
Hi, i need to convert the following code:
</font><blockquote><font size=“1” face=“Verdana, Arial”>code:</font><hr /><pre style=“font-size:x-small; font-family: monospace;”>
for (i=0; i<o->nPlanes;i++)
{
if (o->planes[i].visible)
for (j=0;j<3;j++)
{
k = o->planes[i].neigh[j];
//if ((!k)
Then again, hopefully it will show all my post this time
Hi, i need to convert the following code:
for (i=0; i<o->nPlanes;i++)
{
if (o->planes[i].visible)
for (j=0;j<3;j++)
{
k = o->planes[i].neigh[j];
if ((!k) (!o->planes[k-1].visible))
{
p1 = o->planes[i].p[j];
jj = (j+1)%3;
p2 = o->planes[i].p[jj];
v1.x = (o->points[p1].x - lp[0])*100;
v1.y = (o->points[p1].y - lp[1])*100;
v1.z = (o->points[p1].z - lp[2])*100;
v2.x = (o->points[p2].x - lp[0])*100;
v2.y = (o->points[p2].y - lp[1])*100;
v2.z = (o->points[p2].z - lp[2])*100;
glBegin(GL_TRIANGLE_STRIP);
glVertex3f(o->points[p1].x,
o->points[p1].y,
o->points[p1].z);
glVertex3f(o->points[p1].x + v1.x,
o->points[p1].y + v1.y,
o->points[p1].z + v1.z);
glVertex3f(o->points[p2].x,
o->points[p2].y,
o->points[p2].z);
glEnd();
}
}
}
I have difficulties building up the g_indexArray and glVertexPointer arrays, can someone help ? Thanks
Take a look at the VBO extension. Supported on most platforms(with newer drivers), fairly easy interface. For a tutorial on using VBOs do a search google.
A simple example:
http://www.devmaster.net/articles/oglVertexBuffer/