I''m using blender to export a model
(I''m using a model of the decopter project)
import Blender
file=fopen("file","w")
for object in Blender.Object.GetSelected();
mesh=object.data
for v in mesh.verts:
file.write("%f %f %f\n" % (v.co.x , v.co.y , v.co.z))
file.close();
It exports fine,
I get a list of coordinates in my file...
I load the file using my opengl program,
but that doesn''t went fine
( see http://www.anemaet.nl/snapshot2.png )
This is the code I''m using to load it:
while (!feof(file)){
fscanf(file,"%f %f %f",&this->v1_1,&this->v1_2,&this->v1_3);
fscanf(file,"%f %f %f",&this->v2_1,&this->v2_2,&this->v2_3);
fscanf(file,"%f %f %f",&this->v3_1,&this->v3_2,&this->v3_3);
printf("\n %f %f %f",this->v1_1,this->v1_2,this->v1_3);
printf("\n %f %f %f",this->v2_1,this->v2_2,this->v2_3);
printf("\n %f %f %f",this->v3_1,this->v3_2,this->v3_3);
i++;
}
</pre>
And here''s the code I''m using to draw it:
<pre>
glBegin(GL_TRIANGLES);
for (i=0; i<this->nrobjs; i++){
//glTexCoord2f(this->tv1_1,this->tv1_2);
glVertex3f(this->v1_1,this->v1_2,this->v1_3);
glVertex3f(this->v2_1,this->v2_2,this->v2_3);
glVertex3f(this->v3_1,this->v3_2,this->v3_3);
}
glEnd();
</pre>
Thanks in advice,
Frank </i>