Normand Briere
2019-08-26 6266c8a4b2485b29a7d5bcb217460d7aad3e1c4a
Camera.java
....@@ -3,7 +3,6 @@
33 // Decompiler options: packimports(3)
44 // Source File Name: Camera.java
55
6
-
76 class Camera extends Object3D
87 {
98 static final long serialVersionUID = 4754289789178680517L;
....@@ -11,7 +10,7 @@
1110 /*static*/ float DECAL = 12; // 3;
1211 /*static*/ float SCALE = 1; // 0.5f;
1312
14
- float shaper_fovy = 60.0f;
13
+ float shaper_fovy = 25.0f;
1514 float shaper_zNear = 0.01f;
1615 float shaper_zFar = 1E5f; // 500.0f;
1716
....@@ -21,8 +20,8 @@
2120 //<-2.2,0.7,-2> and pointed it at <-0.61,0.3,-0.6>
2221 // location = LA.newVector(2,0.7,-2);
2322 // lookAt = new cVector(0.6,0.3,-0.6);
24
- location = LA.newVector(2,0.7,2);
25
- lookAt = new cVector(0.0,0.3,0);
23
+ location = LA.newVector(6,2,4);
24
+ lookAt = new cVector(0.0,0.5,0);
2625 direction = new cVector();
2726 toParent = LA.newMatrix();
2827 fromParent = LA.newMatrix();
....@@ -53,7 +52,7 @@
5352 perspective = true;
5453 break;
5554 case 1: // '\001'
56
- location = LA.newVector(0, 0, 4);
55
+ location = LA.newVector(4, 0, 0);
5756 perspective = false;
5857 break;
5958 case 2: // '\002'
....@@ -64,7 +63,7 @@
6463 //LA.matXRotate(fromScreen, LA.toRadians(90));
6564 break;
6665 case 3: // '\003'
67
- location = LA.newVector(4, 0, 0);
66
+ location = LA.newVector(0, 0, 4);
6867 //LA.matZRotate(toScreen, LA.toRadians(-90));
6968 //LA.matXRotate(toScreen, LA.toRadians(-90));
7069 //LA.matXRotate(fromScreen, LA.toRadians(90));
....@@ -72,7 +71,7 @@
7271 perspective = false;
7372 break;
7473 case 4: // Default light
75
- location = LA.newVector(10, 30, 20);
74
+ location = LA.newVector(-5, 15, 10);
7675 perspective = false;
7776 break;
7877 }
....@@ -105,6 +104,15 @@
105104 focalLength = 1;
106105 setAspect(4, 3);
107106 background = LA.newVector(0.8, 0.8, 0.8);
107
+ }
108
+
109
+ void CreateMaterial(boolean multiply)
110
+ {
111
+ super.CreateMaterial(multiply);
112
+
113
+ material.shift = 90;
114
+ material.cameralight = 0.2f;
115
+ material.shadowbias = 10;
108116 }
109117
110118 void setAspect(int width, int height)
....@@ -320,7 +328,7 @@
320328 location.set(lookAt);
321329 lookAt.set(cStatic.point1);
322330
323
- computeTransform();
331
+ //computeTransform();
324332 }
325333
326334 //synchronized // june 2014
....@@ -392,13 +400,15 @@
392400 if (CameraPane.ROTATECAMERA)
393401 {
394402 double[][] rotate = { { 0,1,0,0 }, { -1,0,0,0}, { 0,0,1,0}, { 0,0,0,1 } };
395
- double[][] rotate_1 = { { 0,-1,0,0 }, { 1,0,0,0}, { 0,0,1,0}, { 0,0,0,1 } };
403
+ //double[][] rotate_1 = { { 0,-1,0,0 }, { 1,0,0,0}, { 0,0,1,0}, { 0,0,0,1 } };
396404
397
- LA.matConcat(rotate, fromScreen, fromScreen);
398
- LA.matConcat(toScreen, rotate_1, toScreen);
405
+ LA.matConcat(fromScreen, rotate, fromScreen);
406
+ //LA.matConcat(toScreen, rotate_1, toScreen);
399407 }
400408 //if (this == CameraPane.lightCamera)
401409 //CameraPane.lighttouched = true;
410
+
411
+ LA.matInvert(fromScreen, toScreen);
402412 }
403413
404414 // void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected)