Three.js立方体
2021/5/17 18:25:28
本文主要是介绍Three.js立方体,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
平面和缓冲平面:
var geometry = new Three.PlaneBufferGeometry( 10, 10, 1,1 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var mesh= new Three.Mesh( geometry, material ); this.scene.add( mesh); var geometry = new Three.PlaneGeometry( 10, 10, 1,1 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var mesh= new Three.Mesh( geometry, material ); this.scene.add( mesh);
球体和缓冲球体
var geometry = new Three.SphereGeometry(1.6,40,40); var material = new Three.MeshLambertMaterial({ color:0x0000FF, wireframe:false}); this.mesh = new Three.Mesh( geometry, material ); this.mesh.position.set(0,0,0) this.scene.add( this.mesh ); var geometry = new Three.SphereBufferGeometry(1.6,40,40); var material = new Three.MeshLambertMaterial({ color:0x0000FF, wireframe:false}); this.mesh = new Three.Mesh( geometry, material ); this.mesh.position.set(0,0,0) this.scene.add( this.mesh );
立方体和缓冲立方体:
var geometry = new Three.BoxGeometry( 1, 1, 1 ); var material = new Three.MeshBasicMaterial( {color: 0x00ff00} ); var cube = new Three.Mesh( geometry, material ); this.scene.add(cube)
var geometry = new Three.BoxBufferGeometry( 1, 1, 1 ); var material = new Three.MeshBasicMaterial( {color: 0x00ff00} ); var cube = new Three.Mesh( geometry, material ); this.scene.add(cube)
圆形几何体和圆形缓冲几何体:
var geometry = new Three.CircleGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var circle = new Three.Mesh( geometry, material ); this.scene.add( circle );
var geometry = new Three.CircleBufferGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var circle = new Three.Mesh( geometry, material ); this.scene.add( circle );
圆锥几何体和圆锥缓冲几何体:
var geometry = new Three.ConeGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cone= new Three.Mesh( geometry, material ); this.scene.add( cone);
var geometry = new Three.ConeBufferGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cone= new Three.Mesh( geometry, material ); this.scene.add( cone);
圆柱和圆柱缓冲几何体:
var geometry = new Three.CylinderGeometry(5, 5, 20, 32); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cylinder= new Three.Mesh( geometry, material ); this.scene.add( cylinder)
var geometry = new Three.CylinderBufferGeometry(5, 5, 20, 32); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cylinder= new Three.Mesh( geometry, material ); this.scene.add( cylinder)
十二面几何体和缓冲十二面几何体
var geometry = new Three.DodecahedronBufferGeometry(5, 5, 20, 32); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var mesh= new Three.Mesh( geometry, material ); this.scene.add( mesh)
var geometry = new Three.DodecahedronBufferGeometry(5, 5, 20, 32); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var mesh= new Three.Mesh( geometry, material ); this.scene.add( mesh)
这篇关于Three.js立方体的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Vue新手入门教程:从零开始学习Vue框架
- 2024-11-23如何集成Ant Design Vue的图标
- 2024-11-23如何集成Ant Design Vue图标
- 2024-11-23使用vue CLI快速搭建Vue项目教程
- 2024-11-23Vue CLI多环境配置简单教程
- 2024-11-23Vue3入门教程:轻松搭建你的第一个Vue3应用
- 2024-11-23Vue3+Vite快速上手指南
- 2024-11-23Vue3阿里系UI组件入门指南
- 2024-11-23Vue3的阿里系UI组件入门指南
- 2024-11-23Vue3公共组件入门教程