فهرست منبع

Merge pull request #4250 from RaananW/msft-examples

examples on how to reconfigure the viewer using external files
Raanan Weber 7 سال پیش
والد
کامیت
1964fa2858

BIN
Viewer/dist/external/msft/EnvMap_2.0-256.env


BIN
Viewer/dist/external/msft/Ground_2.0-1024.png


BIN
Viewer/dist/external/msft/Skybox_3.0-256.dds


+ 42 - 0
Viewer/dist/external/msft/codeExample.html

@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+
+    <head>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <title>BabylonJS Viewer - Configuration usage with code</title>
+        <style>
+        </style>
+    </head>
+
+    <body>
+        <div id="viewport"></div>
+        <script src="../../viewer.js"></script>
+        <script>
+            var config = {
+                extends: 'extended',
+                configuration: "./config.json",
+                model: {
+                    url: "https://babylonjs.com/Assets/FlightHelmet/glTF/FlightHelmet_Materials.gltf",
+                },
+                templates: {
+                    main: {
+                        params: {
+                            fillScreen: true
+                        }
+                    }
+                },
+                lab: {
+                    assetsRootURL: '/external/msft/'
+                }
+            }
+
+            // create viewer
+            var viewerElement = document.getElementById("viewport");
+            new BabylonViewer.DefaultViewer(viewerElement, config);
+
+        </script>
+    </body>
+
+</html>

+ 25 - 0
Viewer/dist/external/msft/config.json

@@ -0,0 +1,25 @@
+{
+    "ground": {
+        "material": {
+            "primaryColorHighlightLevel": 0.05
+        }
+    },
+    "skybox": {
+        "cubeTexture": {
+            "url": "Skybox_3.0-256.dds"
+        },
+        "material": {
+            "primaryColorShadowLevel": 0.1
+        }
+    },
+    "scene": {
+        "imageProcessingConfiguration": {
+            "vignetteWeight": 0
+        },
+        "mainColor": {
+            "r": 0.9607843137254902,
+            "g": 0.9607843137254902,
+            "b": 0.9607843137254902
+        }
+    }
+}

+ 19 - 0
Viewer/dist/external/msft/htmlExample.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+
+    <head>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <title>BabylonJS Viewer - Configuration usage</title>
+        <style>
+        </style>
+    </head>
+
+    <body>
+        <babylon id="viewer" configuration="./config.json" lab.assets-root-u-r-l="/external/msft/" templates.main.params.fill-screen="true"
+            extends="extended" model.url="https://babylonjs.com/Assets/FlightHelmet/glTF/FlightHelmet_Materials.gltf"></babylon>
+        <script src="../../viewer.js"></script>
+    </body>
+
+</html>