CameraLightSource
Inherits LightSource
This LightSource type represents a light source placed at the position of the camera. An object with this light source will always be illuminated from the current view direction.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
The intensity of this light source. |
|
Value of type ‘Double’ |
Yes |
Inherited members from LightSource
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
The identifier of the light source. |
|
An identifier string. May not contain ‘.’, spaces, newlines, or tabs |
No |
|
The type of light source that is described in this element. |
|
Must name a valid |
No |
|
Whether the light source is enabled or not. |
|
Value of type ‘Boolean’ |
Yes |
Asset Examples
1-- Model Distance
2-- Creates a screen space window into which 3D model of the Eiffel tower is rendered. As
3-- the objects are rendered in meter scale, and the Eiffel tower is about 300m tall, we
4-- place the camera at a great distance to be able to see the entire Eiffel tower at the
5-- same time.
6
7-- Download the model file for the Eiffel tower
8local modelFolder = asset.resource({
9 Name = "Scale Eiffel Tower",
10 Type = "HttpSynchronization",
11 Identifier = "scale_model_eiffel_tower",
12 Version = 1
13})
14
15local Object = {
16 Type = "ScreenSpaceRenderableRenderable",
17 Identifier = "ScreenSpaceRenderableRenderable_Example_ModelDistance",
18 Renderable = {
19 Type = "RenderableModel",
20 GeometryFile = modelFolder .. "eiffeltower.osmodel",
21 RotationVector = { 0.0, 45.0, 0.0 },
22 LightSources = {
23 {
24 Identifier = "Camera",
25 Type = "CameraLightSource",
26 Intensity = 5.0
27 }
28 }
29 },
30 Scale = 1.25,
31 CameraPosition = { 0.0, 3500.0, 9000.0 },
32 CameraCenter = { 0.0, 2750.0, 0.0 }
33}
34
35asset.onInitialize(function()
36 openspace.addScreenSpaceRenderable(Object)
37end)
38
39asset.onDeinitialize(function()
40 openspace.removeScreenSpaceRenderable(Object)
41end)