Q1) I have an ObjGroup object, (a cube :D). Is there a way of finding the normals for each vertex? Ideally for each face, to account for shared verts at corners.If the obj file does not supply vertex normals, then you have to create them yourself by calling interpolateNormals() on the ObjGroup, otherwise face normals will be used. If you want the face normal, then use the computeNormal() function on the triangles that make up the ObjGroup. For instance, myobjGroup.get(triID)->computeNormal(context, rays); You can also look at something like KenslerShirleyTriangle.cc's implementation of computeNormal() to see how you could do it manually.
These are my print outs for a ObjGroup cube.Yes if the obj file did not contain vertex normals and you didn't call interpolateNormals().
vertices.size()=8
vertex_indices.size()=36
vertexNormals.size()=0
normal_indices.size()=0
Q2) Should the last two == 0 ?
I don't know this off the top of my head. Someone else on the list might though.
Q3) Also I've loaded a HDR image into an EnvMapBackground object. Is there a way of looking up a radiance value from a vector? Or do I need to go through Texture<Color>* from within EnvMapBackground?
Archive powered by MHonArc 2.6.16.