~seh999/jcog/proto3

« back to all changes in this revision

Viewing changes to spacetime/src.render.sunflow/opencog/spacetime/render/sunflow/PerezSky.java

  • Committer: SeH
  • Date: 2009-09-19 22:59:48 UTC
  • Revision ID: seh999@gmail.com-20090919225948-q3ab80xa57i74mm6
start of major jReality refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import java.awt.image.BufferedImage;
4
4
 
5
 
import opencog.spacetime.math.MatrixBuilder;
6
 
import opencog.spacetime.scene.DirectionalLight;
7
 
import opencog.spacetime.scene.Geometry;
8
 
import opencog.spacetime.scene.SceneGraphComponent;
 
5
import opencog.math.MatrixBuilder;
9
6
import opencog.spacetime.shader.ImageData;
 
7
import opencog.spacetime.space.DirectionalLight;
 
8
import opencog.spacetime.space.Geometry;
 
9
import opencog.spacetime.space.SpaceComponent;
10
10
 
11
11
import org.sunflow.core.ParameterList;
12
12
import org.sunflow.core.ParameterList.InterpolationType;
22
22
        
23
23
        private DirectionalLight sunLight;
24
24
        private DirectionalLight skyAmbientLight;
25
 
        private SceneGraphComponent sunLightNode;
26
 
        private SceneGraphComponent skyAmbientNode;
27
 
        private SceneGraphComponent lightComponent;
 
25
        private SpaceComponent sunLightNode;
 
26
        private SpaceComponent skyAmbientNode;
 
27
        private SpaceComponent lightComponent;
28
28
        
29
29
        public PerezSky() {
30
30
                this(32, null, new double[]{0,1,1});
35
35
                this.resolution = resolution;
36
36
                this.turbidity = turbidity;
37
37
                //skyLight.setThreshold(2f/resolution);
38
 
                lightComponent = new SceneGraphComponent();
 
38
                lightComponent = new SpaceComponent();
39
39
                sunLight = new DirectionalLight();
40
40
                // TODO: uncomment when SunSkyLight works       
41
41
                sunLight.setAmbientFake(true);
42
42
                sunLight.setName("sun light");
43
 
                sunLightNode = new SceneGraphComponent("sun");
 
43
                sunLightNode = new SpaceComponent("sun");
44
44
                sunLightNode.setLight(sunLight);
45
45
                MatrixBuilder.euclidean().rotateFromTo(new double[] { 0, 0, 1 },
46
46
                                new double[] { 0, 1, 1 }).assignTo(sunLightNode);
47
47
                lightComponent.addChild(sunLightNode);
48
48
 
49
 
                skyAmbientNode = new SceneGraphComponent("skyAmbient");
 
49
                skyAmbientNode = new SpaceComponent("skyAmbient");
50
50
                skyAmbientLight = new DirectionalLight();
51
51
                skyAmbientLight.setAmbientFake(true);
52
52
                skyAmbientLight.setName("sky light");
145
145
                }
146
146
        }
147
147
 
148
 
        public SceneGraphComponent getLightComponent() {
 
148
        public SpaceComponent getLightComponent() {
149
149
                return lightComponent;
150
150
        }
151
151
}