- BabylonJS 教程
- BabylonJS - 主頁
- BabylonJS - 簡介
- BabylonJS - 環境設定
- BabylonJS - 概述
- BabylonJS - 基本元素
- BabylonJS - 材質
- BabylonJS - 動畫
- BabylonJS - 攝像頭
- BabylonJS - 光源
- BabylonJS - 引數曲面
- BabylonJS - 網格
- 向量位置與旋轉
- BabylonJS - 貼花
- BabylonJS - 三維曲線
- BabylonJS - 動態紋理
- BabylonJS - 視差對映
- BabylonJS - 鏡頭光暈
- BabylonJS - 建立螢幕截圖
- BabylonJS - 反射探針
- 標準渲染流程
- BabylonJS - 著色材質
- BabylonJS - 骨骼
- BabylonJS - 物理引擎
- BabylonJS - 播放聲音與音樂
- BabylonJS 實用資源
- BabylonJS - 快速指南
- BabylonJS - 實用資源
- BabylonJS - 討論
BabylonJS - 線框模型
使用線框模型,你可以只使用線條和頂點獲得 3D 模型的骨架。現在讓我們看看如何將線框模型應用於任何形狀。
語法
materialforbox.wireframe = true;
演示
<!doctype html>
<html>
<head>
<meta charset = "utf-8">
<title>BabylonJs - Basic Element-Creating Scene</title>
<script src = "babylon.js"></script>
<style>
canvas {width: 100%; height: 100%;}
</style>
</head>
<body>
<canvas id = "renderCanvas"></canvas>
<script type = "text/javascript">
var canvas = document.getElementById("renderCanvas");
var engine = new BABYLON.Engine(canvas, true);
var createScene = function() {
var scene = new BABYLON.Scene(engine);
scene.clearColor = new BABYLON.Color3(0, 1, 0);
scene.ambientColor = new BABYLON.Color3(0.3, 0.3, 0.3);
var camera = new BABYLON.ArcRotateCamera("Camera", 1, 0.8, 10, new BABYLON.Vector3(0, 0, 0), scene);
camera.attachControl(canvas, true);
var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
light.intensity = 0.7;
var materialforbox = new BABYLON.StandardMaterial("texture1", scene);
var box = BABYLON.Mesh.CreateBox("box", '3', scene);
box.material = materialforbox;
materialforbox.wireframe = true;
return scene;
};
var scene = createScene();
engine.runRenderLoop(function() {
scene.render();
});
</script>
</body>
</html>
輸出
babylonjs_materials.htm
廣告