PDA

View Full Version : 3ds float assignment according a file



vivek vyas
08-09-2009, 02:40 AM
hi

i am working with lib3ds
and here is a part of file



float Trivert[64][3];
Lib3dsMesh *testmesh;
void Load3Ds(const char *Filename, float Trivert[64][3])
{
//Function is just started

Lib3dsFile *testfile;
Lib3dsIo *testio;

printf("Testing of 3ds file in OpenGL\n");
printf("how to load 3ds file for reading data\n");

testfile = lib3ds_file_open(Filename);

fprintf(stdout,"before assginig array\n");

for(int i=0;i<=(testfile->meshes_size)/12;i++)
lib3ds_quat_copy(Trivert[i],testfile->meshes[0]->vertices[i]);

fprintf(stdout,"array assigned successful\n");
//Success
}


Here My Problem is
As i make Trivert[64][3]
a big block in memory
i want to make
a pointer *Trivert[3]
i am not Guru in programming
so is *Trivert[3] means Trivert[3]as_long_we_assign]
or
Trivert[as_long_we_assign][3]
and i want to do that because if the file contains more than 65 points then this Trivert[64][3]
may be give up and if less then 65 points then the remain are going to be waste

i ry to make that *Trivert[3] with change in thus assigning Trivert suitably

programme get compiled but on running it give me a segmentation error without that it just works and objects get created

:( Please help me :(
i am just a beginner in OpenGL
thanks in advance

vivek vyas
08-09-2009, 06:08 AM
code is a bug i tested many files
(huh need some resources)
please some one can help
reply