Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COI think you're right that I'm doing the normals / normal indices wrong. It looks like in normalVectorsToNormalArrays() I'm only adding one normal per face. What I think I should be doing (and correct me if I'm wrong), is I should be adding a normal for each vertex. I'll try to fix that tomorrow and see if I get better lighting results. Thanks for the pointer!
      singulars
    2. COI'm now loading a normal for every vertex (is that right, or should it be 1 normal for each face?). But I'm loading the normals in their .obj file's index order, so this obviously still isn't working properly, because like you said, the normals and the vertices **must share the same index**... I'm having a hard time trying to visualize how to achieve this and the pseudo-code at the link you gave me isn't making a whole lot of sense to me (I've been reading it over and over), nor is google turning up anything useful. I'll keep trying things, but could you (or someone) give me more advise?
      singulars
    3. COMy first advice would just be to not reinvent the wheel and go download Assimp (http://assimp.sourceforge.net/), so you can get on with more interesting things :) . I don't have time for a full blown explanation, but if you want to do it yourself it boils down to: create a new vector of structs called "vertex" that contain position, normal, texcoord, etc. Then go through the obj file and every time you find a unique pair of position/normal/texcoord, copy the data into a new vertex so that it's all together (a STL map is useful for detecting duplicates). Then use this new vector to draw from.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload