【three.js案例一】智慧星球

直接附上源码:

import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

//场景
const scene = new THREE.Scene();

const geometry = new THREE.SphereGeometry(50,32,16);

console.log('.postion',geometry.attributes.position);
console.log('.index',geometry.index);
const material = new THREE.MeshLambertMaterial({
    color: 0x00ffff, 
    wireframe:true,
});
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);

//辅助观察的坐标系
const axesHelper = new THREE.AxesHelper(100);
// scene.add(axesHelper);


//光源设置
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(100, 60, 50);
scene.add(directionalLight);
const ambient = new THREE.AmbientLight(0xffffff, 0.

相关推荐

  1. HarmonyOS NEXT 星河版项目案例

    2024-06-17 03:54:02       32 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-17 03:54:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-17 03:54:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-17 03:54:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-17 03:54:02       18 阅读

热门阅读

  1. 2024前端面试准备6-TS基础

    2024-06-17 03:54:02       7 阅读
  2. vue3 如何给表单添加表单效验+正则表达式

    2024-06-17 03:54:02       6 阅读
  3. LeetCode热题1. 两数之和

    2024-06-17 03:54:02       6 阅读
  4. git diff

    2024-06-17 03:54:02       8 阅读
  5. windows用脚本编译qt的项目

    2024-06-17 03:54:02       6 阅读
  6. Window上ubuntu子系统编译Android

    2024-06-17 03:54:02       6 阅读
  7. react捡起来了

    2024-06-17 03:54:02       6 阅读
  8. python判断一个数是不是偶数

    2024-06-17 03:54:02       9 阅读
  9. 编程机器人的参数表怎么看

    2024-06-17 03:54:02       6 阅读
  10. AI芯片战场的迁徙:从训练到推理的深度剖析

    2024-06-17 03:54:02       6 阅读
  11. Linux部署FTP服务

    2024-06-17 03:54:02       5 阅读