Browse Source

add a-sun-sky

Nikolay Suslov 7 năm trước cách đây
mục cha
commit
0fdf9d690d

+ 4 - 1
public/ohmlang-lsys/index.vwf.html

@@ -11,9 +11,12 @@
 
             let props = ["angle", "iteration", "stepLength", "rule", "axiomF", "axiomG"]
 
-
+            let readyForDraw = vwf.getProperty(nodeID, 'readyForDraw');
             if (props.includes(propertyName)) {
+
+                if (readyForDraw) {
                 vwf_view.kernel.callMethod(nodeID, "makeLSys");
+                }
                  //console.log(propertyName +' - '+ propertyValue);
             }
 

+ 3 - 3
public/ohmlang-lsys/index.vwf.yaml

@@ -6,9 +6,9 @@ properties:
     assets: "assets.json"
 children:
     sky:
-        extends: http://vwf.example.com/aframe/asky.vwf
+        extends: http://vwf.example.com/aframe/a-sun-sky.vwf
         properties:
-            color: "#ECECEC"
+            sunPosition: "-0.2 5 -5"
     groundPlane:
         extends: http://vwf.example.com/aframe/aplane.vwf
         properties:
@@ -41,7 +41,7 @@ children:
                     linepath:
                         extends: http://vwf.example.com/aframe/linepath.vwf
                         properties:
-                            color: "green"
+                            color: "#445447"
                             path: []
                             width: 0.02
             lsysLang:

+ 2 - 2
public/simple/index.vwf.yaml

@@ -18,6 +18,6 @@ children:
           color: "#b74217"
           path: [{"x":0.0, "y":0.0, "z":0.0}, {"x":2.0, "y":1.0, "z":1.0},{"x":3.0, "y":5.0, "z":2.0}]
   sky:
-    extends: http://vwf.example.com/aframe/asky.vwf
+    extends: http://vwf.example.com/aframe/a-sun-sky.vwf
     properties:
-      color: "#ECECEC"
+      sunPosition: "-0.2 5 -5"

+ 4 - 10
support/client/lib/vwf.js

@@ -329,7 +329,7 @@
                     "vwf/model/aframe/extras/aframe-extras": {
                         deps: [ "vwf/model/aframe/aframe-master" ]
                     },
-                    "vwf/model/aframe/addon/SkyShader": {
+                    "vwf/model/aframe/addon/aframe-sun-sky": {
                         deps: [ "vwf/model/aframe/aframe-master" ]
                     },
                     "vwf/model/aframe/addon/BVHLoader": {
@@ -345,7 +345,7 @@
                     "vwf/model/aframe/addon/monument-app": {
                         deps: [ "vwf/model/aframe/aframe-master",
                         "vwf/model/aframe/extras/aframe-extras",
-                        "vwf/model/aframe/addon/SkyShader",
+                        "vwf/model/aframe/addon/aframe-sun-sky",
                         "vwf/model/aframe/addon/BVHLoader",
                         "vwf/model/aframe/addon/TransformControls",
                         "vwf/model/aframe/addon/THREE.MeshLine"
@@ -398,18 +398,12 @@
 
                 { library: "vwf/model/ohm", active: true },
               
-               
-
-                { library: "vwf/model/aframe/addon/monument-app", 
-                linkedLibraries: [ "vwf/model/aframe/addon/SkyShader" ], 
-                active: false 
-            },
 
                   { library: "vwf/model/aframe", 
                     linkedLibraries: [ "vwf/model/aframe/aframe-master",
                     "vwf/model/aframe/extras/aframe-extras",
                     "vwf/model/aframe/addon/aframe-interpolation",
-                    "vwf/model/aframe/addon/SkyShader",
+                    "vwf/model/aframe/addon/aframe-sun-sky",
                     "vwf/model/aframe/addon/monument-app",
                     "vwf/model/aframe/addon/BVHLoader",
                     "vwf/model/aframe/addon/TransformControls",
@@ -471,7 +465,7 @@
                 { library: "vwf/model/aframe/aframe-master", active: false },
                 { library: "vwf/model/aframe/extras/aframe-extras", active: false },
                 { library: "vwf/model/aframe/addon/aframe-interpolation", active: false },
-                { library: "vwf/model/aframe/addon/SkyShader", active: false },
+                { library: "vwf/model/aframe/addon/aframe-sun-sky", active: false },
                 { library: "vwf/model/aframe/addon/monument-app", active: false },
                 { library: "vwf/model/aframe/addon/BVHLoader", active: false },
                 { library: "vwf/model/aframe/addon/TransformControls", active: false },

+ 35 - 0
support/client/lib/vwf/model/aframe.js

@@ -592,6 +592,23 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
                             break;
                     }
                 }
+                if (value === undefined && aframeObject.nodeName == "A-SUN-SKY") {
+                    value = propertyValue;
+                    switch (propertyName) {
+
+                        case "sunPosition":
+                            aframeObject.setAttribute('material', 'sunPosition', propertyValue);
+                            break;
+
+                        // case "active":
+                        //     aframeObject.setAttribute('camera', 'active', propertyValue);
+                        //        break;
+
+                        default:
+                            value = undefined;
+                            break;
+                    }
+                }
 
             }
             return value;
@@ -850,6 +867,22 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
                     //         }
                 }
 
+                if (value === undefined && aframeObject.nodeName == "A-SUN-SKY") {
+                    
+                    
+                                        switch (propertyName) {
+                                            case "sunPosition":
+                                                value = aframeObject.getAttribute('material').sunPosition;
+                                                break;
+                                        }
+                    
+                                        //    switch (propertyName) {
+                                        //         case "active":
+                                        //             value = aframeObject.getAttribute('camera').active;
+                                        //             break;
+                                        //         }
+                                    }
+
                 if (value === undefined && aframeObject.nodeName == "A-COLLADA-MODEL") {
 
                     switch (propertyName) {
@@ -900,6 +933,8 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
             aframeObj = document.createElement('a-cursor');
         } else if (self.state.isAFrameClass(protos, "http://vwf.example.com/aframe/asky.vwf")) {
             aframeObj = document.createElement('a-sky');
+        } else if (self.state.isAFrameClass(protos, "http://vwf.example.com/aframe/a-sun-sky.vwf")) {
+                aframeObj = document.createElement('a-sun-sky');
         } else if (self.state.isAFrameClass(protos, "http://vwf.example.com/aframe/abox.vwf")) {
             aframeObj = document.createElement('a-box');
         } else if (self.state.isAFrameClass(protos, "http://vwf.example.com/aframe/aplane.vwf")) {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 97 - 0
support/client/lib/vwf/model/aframe/addon/aframe-sun-sky.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
support/client/lib/vwf/model/aframe/addon/aframe-sun-sky.min.js


+ 0 - 82
support/client/lib/vwf/model/aframe/addon/monument-app.js

@@ -278,88 +278,6 @@ AFRAME.registerComponent('envmap', {
 })
 
 
-//https://threejs.org/examples/webgl_shaders_sky.html
-
-AFRAME.registerComponent('skyshader', {
-
-
-    init: function () {
-
-        let sunSphereEl = document.querySelector('a-scene').querySelector('#sun');
-        this.sunSphere = sunSphereEl.object3D;
-
-        this.sky = new THREE.Sky();
-        let scene = this.el.sceneEl;
-
-
-        let effectController = {
-            turbidity: 5,
-            rayleigh: 2,
-            mieCoefficient: 0.005,
-            mieDirectionalG: 0.8,
-            luminance: 1,
-            inclination: 0, // elevation / inclination
-            azimuth: 0.25, // Facing front,
-            sun: ! true
-        };
-
-        let uniforms = this.sky.uniforms;
-        uniforms.turbidity.value = effectController.turbidity;
-        uniforms.rayleigh.value = effectController.rayleigh;
-        uniforms.luminance.value = effectController.luminance;
-        uniforms.mieCoefficient.value = effectController.mieCoefficient;
-        uniforms.mieDirectionalG.value = effectController.mieDirectionalG;
-
-        this.el.setObject3D('mesh', this.sky.mesh);
-
-        let distance = 400000;
-
-        var theta = Math.PI * (effectController.inclination - 0.5);
-        var phi = 2 * Math.PI * (effectController.azimuth - 0.5);
-
-        this.sunSphere.position.x = distance * Math.cos(phi);
-        this.sunSphere.position.y = distance * Math.sin(phi) * Math.sin(theta);
-        this.sunSphere.position.z = distance * Math.sin(phi) * Math.cos(theta);
-
-        this.sunSphere.visible = effectController.sun;
-        this.sky.uniforms.sunPosition.value.copy(this.sunSphere.position);
-
-
-    },
-
-    update: function () {
-
-    },
-
-    tick: function (t) {
-
-    }
-})
-
-AFRAME.registerComponent('sun', {
-
-
-    init: function () {
-
-        this.sunSphere = new THREE.Mesh(
-            new THREE.SphereBufferGeometry(20000, 16, 8),
-            new THREE.MeshBasicMaterial({ color: 0xffffff })
-        );
-        this.sunSphere.position.y = - 700000;
-        this.sunSphere.visible = true;
-
-        this.el.setObject3D('mesh', this.sunSphere);
-
-    },
-
-    update: function () {
-    },
-
-    tick: function (t) {
-    }
-})
-
-
 AFRAME.registerComponent('avatarbvh0', {
 
     /**

+ 0 - 18
support/client/lib/vwf/model/aframeComponent.js

@@ -894,24 +894,6 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
 
         }
 
-        if (self.state.isComponentClass(protos, "http://vwf.example.com/aframe/app-sun-component.vwf")) {
-
-
-            // aframeObj.el.setAttribute(node.type, {});
-            aframeObj.compName = "sun";
-            aframeObj.el.setAttribute('id', "sun");
-            aframeObj.el.setAttribute(aframeObj.compName, {});
-
-        }
-
-        if (self.state.isComponentClass(protos, "http://vwf.example.com/aframe/app-skyshader-component.vwf")) {
-
-
-            // aframeObj.el.setAttribute(node.type, {});
-            aframeObj.compName = "skyshader";
-            aframeObj.el.setAttribute(aframeObj.compName, {});
-
-        }
 
         if (self.state.isComponentClass(protos, "http://vwf.example.com/aframe/app-avatarbvh-component.vwf")) {
 

+ 5 - 0
support/proxy/vwf.example.com/aframe/a-sun-sky.vwf.yaml

@@ -0,0 +1,5 @@
+# a-sun-sky
+--- 
+extends: http://vwf.example.com/aframe/aentity.vwf
+properties:
+  sunPosition:

+ 0 - 5
support/proxy/vwf.example.com/aframe/app-skyshader-component.vwf.yaml

@@ -1,5 +0,0 @@
-# Interpolation
----
-extends: http://vwf.example.com/aframe/aentityComponent.vwf
-type: "component"
-properties:

+ 0 - 5
support/proxy/vwf.example.com/aframe/app-sun-component.vwf.yaml

@@ -1,5 +0,0 @@
-# Interpolation
----
-extends: http://vwf.example.com/aframe/aentityComponent.vwf
-type: "component"
-properties:

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác