• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Three.js_old1: Three.js 是一款运行在浏览器中的 3D 引擎,你可以用它创建各种三维场 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Three.js_old1

开源软件地址:

https://gitee.com/mirrors/Three.js_old1

开源软件介绍:

three.js

NPM PackageBuild SizeNPM DownloadsDeepScanDiscord

JavaScript 3D library

The aim of the project is to create an easy to use, lightweight, cross-browser, general purpose 3D library. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available in the examples.

ExamplesDocumentationWikiMigratingQuestionsForumSlack

Usage

This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL renderer for the scene and camera, and it adds that viewport to the document.body element. Finally, it animates the cube within the scene for the camera.

import * as THREE from 'three';// initconst camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 );camera.position.z = 1;const scene = new THREE.Scene();const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );const material = new THREE.MeshNormalMaterial();const mesh = new THREE.Mesh( geometry, material );scene.add( mesh );const renderer = new THREE.WebGLRenderer( { antialias: true } );renderer.setSize( window.innerWidth, window.innerHeight );renderer.setAnimationLoop( animation );document.body.appendChild( renderer.domElement );// animationfunction animation( time ) {	mesh.rotation.x = time / 2000;	mesh.rotation.y = time / 1000;	renderer.render( scene, camera );}

If everything went well, you should see this.

Cloning this repository

Cloning the repo with all its history results in a ~2 GB download. If you don't need the whole history you can use the depth parameter to significantly reduce download size.

git clone --depth=1 https://github.com/mrdoob/three.js.git

Change log

Releases


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
病毒斗士: Gitee星球的小活动 / Python 贪吃蛇魔改大赛发布时间:2022-03-25
下一篇:
Snague: 一款Roguelike贪吃蛇游戏!发布时间:2022-03-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap