Really i am unable to solve this one
I made an exact code for load all vertex from any file
but there is some assignment problem
here is the code(i changed something)
int nvert
float **vertex;
void Load3Ds(const char *Filename,float **vert,int x)
{
Lib3dsFile *testfile;
Lib3dsIo *testio;
printf("Testing 3-Dimention of 3ds
how to load 3ds file for reading all vertes data
");
testfile = lib3ds_file_open(Filename);
x = testfile->meshes[0]->nvertices;
printf("Number of vertices %i
",x);
vert = new float*[2];
for(int i=0;i<=x;i++)
{
vert[i] = new float[x];
lib3ds_quat_copy(vert[i],testfile->meshes[0]->vertices[i]);
}
printf("x,y,z
");
fprintf(stdout,"size of block by vert is %i
",sizeof(**vert));
}
and when i called
fprintf(stdout,"Test of 3ds file complete vertex scaning
");
Load3Ds("test.3ds",vertex, nvert);
if(!vertex)fprintf(stdout,"vertex can't initialised
");
else if(!x)
{
fprintf(stdout,"count of vertex can't initialised
");
exit(0);
}
else
{
/*if all false show on console*/
...
}
at the point of
Load3Ds(“test.3ds”,vertex, x);
if(!vertex)fprintf(stdout,"vertex can’t initialised
");
else if(!nvert)
{
fprintf(stdout,"count of vertex can’t initialised
");
exit(0);
}
i found vertex and x are not assigned
in my other OpenGL programs which use Load3ds function
they give up
and message come out
Segmentation fault 3232 ./3dtes
if i use int prototype to define Load3ds
and assign to nvert
nvert works
but vertex not assigned
and vice versa(prototype float assigned vertex but nvert??)
(these things sometimes caught by glibc for look like as a bug with long list of /lib/i915_drm(drm,intel was there exact i don’t know)
when i put value of nvert manually after knowing value of testfile->meshes[0]->nvertices)
but
the problem is not come when i put
these line at last of Load3ds definition
nvert = x;
vertex = vert;
}//<-Function definition ends
but using these assignment
is not good idea
please anyone can help me on this perticular
cause i tried so much but these problem not solved very well
any Suggestion in defining function please reply
i hope anyone who read this can understand my problem
please reply to this
in this situation i am really helpless :sorrow:
please give at least link resource if possible
cause i found there no docs of lib3DS just three examples
in the source package