Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] some questions


Chronological Thread 
  • From: harsha sri-narayana <h.sri-narayana@cs.ucl.ac.uk>
  • To: Thiago Ize <thiago@cs.utah.edu>
  • Cc: manta@sci.utah.edu
  • Subject: Re: [Manta] some questions
  • Date: Tue, 29 Jan 2008 17:21:00 +0000

Thank you for your reply. I've created the normals manually, although now I can verify if I've done it correctly. I wasn't sure if my normals were inward or outward facing :D

If anyone else can help on q3 that would be great.
-Harsha

Thiago Ize wrote:
harsha sri-narayana wrote:
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.
vertices.size()=8
vertex_indices.size()=36
vertexNormals.size()=0
normal_indices.size()=0

Q2) Should the last two == 0 ?

Yes if the obj file did not contain vertex normals and you didn't call interpolateNormals().

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?

I don't know this off the top of my head. Someone else on the list might though.

Thiago






Archive powered by MHonArc 2.6.16.

Top of page