Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devwiki:babylon_js [2020/05/14 14:22]
ying [Babylon.js 3D web solution]
devwiki:babylon_js [2020/07/07 21:52] (current)
ying [Extra code control]
Line 15: Line 15:
     *      * 
  
 +====== Extra code control ======
 +
 +**Disable mouse scroll zoom**
 +  * javascript code after camera creation <code javascript>​camera.lowerRadiusLimit = camera.upperRadiusLimit = camera.radius = 4.0; </​code>​
 +
 +**Limite mouse scroll zoom**
 +  * javascript <code javascript>​
 +camera.lowerRadiusLimit = 1;
 +camera.upperRadiusLimit = 50;
 +</​code>​
 +
 +**Disable right mouse button drag pan**
 +  * you can set a camera target <code javascript>​
 +camera.setTarget(box,​ true, true);
 +</​code>​
 +  * you can also use make pan not working<​code javascript>​
 +camera.panningSensibility = 0;
 +</​code>​
 +
 +**invert camera drag rotation direction**
 +  * javascript <code javascript>​camera.angularSensibility = -5000;</​code>​
 +
 +**Force all material backface culling off**
 +  * add that function for import mesh process<​code javascript>​
 +BABYLON.SceneLoader.ImportMesh("",​ "​https://​example.com/​video/​3d/",​ "​my3d.babylon",​ scene, function (newMeshes) { for(let i = 0; i < newMeshes.length;​ i++){ newMeshes[i].material.backFaceCulling = false;} });
 +</​code>​
 ====== Problem and Solution ====== ====== Problem and Solution ======
  
Line 30: Line 56:
     * Solution:     * Solution:
       * go 3d software, check if all the face normal facing outside. check normal direction of those poly face. with face display and show normal to check.       * go 3d software, check if all the face normal facing outside. check normal direction of those poly face. with face display and show normal to check.
 +
 +  * Problem: **chrome, safari shows focus indicator (aka a border line) when mouse select it**
 +    * Solution: css <code css>
 +canvas {
 +  outline: none;
 +  -webkit-tap-highlight-color:​ rgba(255, 255, 255, 0); /* mobile webkit */
 +}
 +</​code>​
  
 ====== Extra Resource ====== ====== Extra Resource ======