gecko0307 / dagon

3D game engine for D
https://gecko0307.github.io/dagon
Other
321 stars 30 forks source link

Crash when loading obj file with quads #73

Closed JakeCoxon closed 2 years ago

JakeCoxon commented 2 years ago

Obj file has f 1/1/1 2/2/1 4/3/1 3/4/1

I think this line needs to be else if

  }
  if (sscanf(tmpStr.ptr, "f %u/%u/%u %u/%u/%u %u/%u/%u", &v1, &t1, &n1, &v2, &t2, &n2, &v3, &t3, &n3) == 9)
  {
gecko0307 commented 2 years ago

By the way, quads can be properly processed at this point, I'll do it soon.

JakeCoxon commented 2 years ago

Thanks! I worked around it by exporting tris but I thought I'd mention it anyway