Skip to content

Commit

Permalink
20.10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
hodiki committed Oct 10, 2020
1 parent 41a81c3 commit 6df4aa4
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions helloWorld/src/zhy/Work1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Work1 extends Vue {
1,
1000
);
camera.position.z = 3;
camera.position.z = 50;
// 创建一个渲染器
interface Obj {
canvas?: any;
Expand All @@ -37,26 +37,32 @@ export default class Work1 extends Vue {
renderer.setSize(window.innerWidth, window.innerHeight);
// 创建一个立方体
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshStandardMaterial({ emissive: 0x4a4a4a });
const cube = new THREE.Mesh(geometry, material);
scene.add(cube);
// const geometry = new THREE.BoxGeometry(1, 1, 1);
// const material = new THREE.MeshStandardMaterial({ emissive: 0x4a4a4a });
// const cube = new THREE.Mesh(geometry, material);
// scene.add(cube);
//创建一个圆环缓冲扭结几何体
const geometry = new THREE.TorusKnotBufferGeometry( 10, 3, 100, 16 );
const material = new THREE.MeshPhongMaterial( { color: 0xffff00 } );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );
//点光源
// const light = new THREE.PointLight(0xfffff, 1, 0);
const light = new THREE.PointLight(0xff000, 1, 0);
light.position.set(0, 5, 0);
const light = new THREE.PointLight(0x0fff0, 1, 0);
light.position.set(0, 50, 0);
scene.add(light);
//网格
const size = 10;
const size = 20;
const divisions = 8;
const gridHelper = new THREE.GridHelper(size, divisions);
// scene.add(gridHelper);
//坐标轴
const axesHelper = new THREE.AxesHelper(5);
// scene.add(axesHelper);
const axesHelper = new THREE.AxesHelper(100);
scene.add(axesHelper);
//轨道控制器
const controls = new OrbitControls(camera, renderer.domElement);
Expand Down

0 comments on commit 6df4aa4

Please sign in to comment.