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