Hi,

I did the second way as you mentioned, i think for direction light beacon does 
not matter if we don't want to move the directional light. If i don't add 
directional light transform nodes in the root node but still i can see the 
geometry, How is it possible?.
Does directional light has special implementation technique?
Even i changed the direction vector of the lights to 1,0,1 instead of 0,1,1. 
The illumination effect does not change.
Reducing the number of light to one. Then also illumination effect does not 
change? why it is so?

I have made the "room" geometry in the Maya and exported in vrml format for 
using in OpenSG.     

See the codes which i wrote.

    // d1Light Atrributes

    beginEditCP(d1Light);
            d1Light->setDirection (Vec3f(0,1,1));
            //d1Light->setBeacon(d1LightTransformNode);
    endEditCP(d1Light);

    // d2Light Attributes
    beginEditCP(d2Light);
            d2Light->setDirection (Vec3f(0,1,1));
            //d1Light->setBeacon(d2LightTransformNode);
    endEditCP(d2Light);

    //d3Light Attributes
    beginEditCP(d3Light);
            d3Light->setDirection (Vec3f(0,1,1));
            //d1Light->setBeacon(d3LightTransformNode);
    endEditCP(d3Light);

    // Set core for d1LightTransformNode
    beginEditCP(d1LightTransformNode);
        d1LightTransformNode->setCore(d1LightTransformCore);
    endEditCP(d1LightTransformNode);

    // Set core for d2LightTransformNode
    beginEditCP(d2LightTransformNode);
        d2LightTransformNode->setCore(d2LightTransformCore);
    endEditCP(d2LightTransformNode);

    //Set core for d3LightTransformNode
    beginEditCP(d3LightTransformNode);
        d3LightTransformNode->setCore(d3LightTransformCore);
    endEditCP(d3LightTransformNode);
    

    // Main root node
    beginEditCP(root);
        root->setCore(g);// Setting core
        root->addChild(room);
        //root->addChild(d1LightTransformNode);
        //root->addChild(d2LightTransformNode);
        //root->addChild(d3LightTransformNode);
    endEditCP(root);
 
Best Regards
Brajesh Lal 

 



----- Original Message ----
From: Carsten Neumann <[EMAIL PROTECTED]>
To: [email protected]
Sent: Saturday, June 16, 2007 12:56:47 PM
Subject: Re: [Opensg-users] Lighting a geometry by muliple lights

Hello Brajesh,

Brajesh Lal wrote:
> Hi,
> 
> I am trying real time Image based lighting concept in OpenSG. I have 
> corresponding approximated number of directional lights generated from the 
> HDR Image using HDRShop. I have all lights position and direction info. I 
> want to illuminate the model with these directional lights.
> I want to lit a geometry ( say "room") by 3 lights. This geometry is having 
> big glass through which lights should come from outside
>  What i did is 
> 1. Made a root for scene ( say " root")
> 2. Added empty group node ( say "g") as a core of  root node and a 
> directional light (d3) as a child of root node
> 4. d3 is having a its transform core and a direction light (d2) as child.
> 5. d2 is having a its transform core and a directional light (d1) as child 
> 6. d1 is having a its transform core and a room as child
> All directional light are placed at 0,0,0 and direction is 0,1,1. These 
> lights represent  Default light (Headlight) is set to false. 

a lights position in the scenegraph only determines the part of the
scene affected (lit) by that light. The light's position in the scene is
determined through the its beacon node. From your description I guess
you want a scene like this:

root
|  [Group]
|
Light_1
| [Dir.Light]
|
L1_Beacon
|  [Transform]
|
Light_2
| [Dir.Light]
|
L2_Beacon
|  [Transform]
|
Light_3
|  [Dir.Light]
|
L3_Beacon
|  [Transform]
|
room
   [Geometry]

This means that room is lit by Light_1, Light_2, Light_3 and by setting
each lights beacon field to the corresponding Node L?_Beacon you can
place the lights in the scene. Note that in this setup, moving a light
also moves all lights below it and the room. To be able to move the
lights independently you could use something like:

root
|  [Group]
+-------------+--------------+--------------+
|             |              |              |
Light_1       L1_Beacon      L2_Beacon      L3_Beacon
| [Dir.Light]    [Transform]    [Transform]   [Transform]
|
Light_2
| [Dir.Light]
|
Light_3
| [Dir.Light]
|
room
   [Geometry]

    Hope it helps,
        Carsten

> I am not able to see the change in the illumination if i add or delete more 
> lights. What wrong i am doing
> 
> Here is the code
> 
> // Setting first Light
> 
>     beginEditCP(d1LightTransformNode);
>         d1LightTransformNode->setCore(d1LightTransform);
>          d1LightTransformNode->addChild(room);
>     endEditCP(d1LightTransformNode);
> 
>     // Setting core and child of the second light of the  
> 
>     beginEditCP(d2LightTransformNode);
>         d2LightTransformNode->setCore(d2LightTransform);
>        d2LightTransformNode->addChild(d1LightTransformNode);
>     endEditCP(d2LightTransformNode);
> 
> // Setting thrid light
>     beginEditCP(d3LightTransformNode);
>         d3LightTransformNode->setCore(d3LightTransform);
>         d3LightTransformNode->addChild(d2LightTransformNode);
>     endEditCP(d3LightTransformNode);
> 
>     // Main root node
>     beginEditCP(root);
>         root->setCore(g);// Setting core
>         root->addChild(d3LightTransformNode);// adding group of lights
>     endEditCP(root);
>  
> Best Regards
> Brajesh Lal 
> 
>  
> 
> 
> 
> 
> 
> 
> 
>  
> ____________________________________________________________________________________
> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo! Games.
> http://videogames.yahoo.com/platform?platform=120121
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users







       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to