welcome to linkAR technical documentation

next previous

Lightning

7.1- Lights

We can load several lights and decide for each model which lights should affect which worlds:

    ...
 
    // Set Sky Model to not be affected by those lights.
    if(![glView setAffectedByLights:FALSE applyToChildren:TRUE withModelId:skyDomeOjbId])
            NSLog(@"Error - setAffectedByLights");
 
    ...
 
    // Set Buttons Model to not be affected by those lights
    if(![glView setAffectedByLights:FALSE applyToChildren:TRUE withModelId:buttonsRootObjId])
            NSLog(@"Error - setAffectedByLights");

Remember these functions can only be applied to Mesh objects, additional info here.

In this scene, we want the lights to apply only to the main scene model. Note that if you do not add those function calls, the sky and the buttons will be affected by lights. However, since those lights are not pointing at them, sky and buttons will look dark.

next previous