Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] Reflections with Obj Files


Chronological Thread 
  • From: Solomon Boulos <boulos@cs.utah.edu>
  • Cc: John Kichury <jjk@sgi.com>, MANTA <manta@sci.utah.edu>
  • Subject: Re: [Manta] Reflections with Obj Files
  • Date: Tue, 23 Oct 2007 13:24:55 -0700

IIRC, the OBJ material spec doesn't have any way to specify the amount of reflectivity only which illumination model is being used. The OBJ material spec is incredibly abused however by every major modeling package as the spec itself is difficult to find and not very expressive.

As far as "moving the light source", you could mean a lot of things there. If you mean to say can you move a point light during runtime, the answer is yes (see Model/Lights/PointLight.h:22, setPosition()) but you'll need to do so within a transaction. The HeadLight supports a similar function (Model/Lights/HeadLight.h:22), which again should be called within a transaction.

As an example, if you have a MantaInterface* called engine, a PointLight* called light and a Vector called position, you can do the following:

engine->addTransaction("Change light position",
                         Callback::create(light,
                                          &PointLight::setPosition,
                                          position));

Once that transaction is processed (after every frame, transactions are processed), your light will be in a different position.

Solomon

On Oct 23, 2007, at 1:16 PM, Thiago Ize wrote:

I found it by looking at the manta and glm source code (I learned about that today as well). Looking at the svn log, it appears that this is something that was added by us and is not standard. Sounds to me like we should document these changes somewhere...

The swig front-end for manta has a menu option for moving the light source. Other people on this list know better than me how to get that to work.

Thiago

John Kichury wrote:
Thanks. That did it.
The obj mtl spec document I have does not mention 'r'.
Do you have a pointer to a full material spec document?

Also, is it possible to move the light source?
I didn't see anything in Manta help for controlling light parameters.


Thanks,

John

-----Original Message-----
From: Thiago Ize [mailto:thiago@cs.utah.edu] Sent: Tuesday, October 23, 2007 12:42 PM
To: John Kichury
Cc: manta@sci.utah.edu
Subject: Re: [Manta] Reflections with Obj Files

I believe reflection is handled by 'r' in an mtl file. For reflections to occur you need to have an "Ns" so that manta knows to use the phong material and not lambertian (lambertian doesn't do reflections) and the 'r' to specify the amount of reflection.

For instance:

newmtl Yellow208
Ns 92.156863
Ka 0.000000 0.000000 0.000000
Kd 0.521600 0.577280 0.286080
Ks 0.250000 0.250000 0.250000
d 1.000000
r 0.4     ---- this is the important part.

Thiago

John Kichury wrote:

Hi,

Is it possible for Manta to render reflections when using obj files?
I tried increasing the material property values such as
specular and
shininess in the material library file which didn't affect
reflections.

Thanks,


John

_______________________
J o h n   K i c h u r y
Principal Systems Engineer, SGI
<jjk@sgi.com>











Archive powered by MHonArc 2.6.16.

Top of page