mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
update readme
This commit is contained in:
parent
48d9ba41ce
commit
3d917f30aa
27
README.md
27
README.md
@ -100,11 +100,11 @@ I first made a simple *Proof of Concept*, take a look at [Demo1.vue](/src/compon
|
|||||||
```html
|
```html
|
||||||
<template>
|
<template>
|
||||||
<Renderer ref="renderer">
|
<Renderer ref="renderer">
|
||||||
<Camera :position="{ z: 100 }"></Camera>
|
<Camera :position="{ z: 100 }" />
|
||||||
<LambertMaterial id="material"></LambertMaterial>
|
<LambertMaterial id="material" />
|
||||||
<Scene>
|
<Scene>
|
||||||
<PointLight :position="{ y: 50, z: 50 }"></PointLight>
|
<PointLight :position="{ y: 50, z: 50 }" />
|
||||||
<Box ref="box" :size="10" :rotation="{ y: Math.PI / 4, z: Math.PI / 4 }" material="material"></Box>
|
<Box ref="box" :size="10" :rotation="{ y: Math.PI / 4, z: Math.PI / 4 }" material="material" />
|
||||||
</Scene>
|
</Scene>
|
||||||
</Renderer>
|
</Renderer>
|
||||||
</template>
|
</template>
|
||||||
@ -127,30 +127,13 @@ export default {
|
|||||||
|
|
||||||
Take a look at [Demo2.vue](/src/components/demos/Demo2.vue).
|
Take a look at [Demo2.vue](/src/components/demos/Demo2.vue).
|
||||||
|
|
||||||
### Template
|
|
||||||
|
|
||||||
```html
|
|
||||||
<Renderer ref="renderer" :orbit-ctrl="{ enableDamping: true, dampingFactor: 0.05 }" mouse-move="body" :mouse-raycast="true">
|
|
||||||
<Camera :position="{ z: 200 }"></Camera>
|
|
||||||
<StandardMaterial id="material" :transparent="true" :opacity="0.9" :metalness="0.8" :roughness="0.5"></StandardMaterial>
|
|
||||||
<Scene id="scene1" background="#000000">
|
|
||||||
<AmbientLight color="#808080"></AmbientLight>
|
|
||||||
<PointLight color="#ff6000"></PointLight>
|
|
||||||
<PointLight ref="light" color="#0060ff" :intensity="0.5" :position="{ z: 200 }"></PointLight>
|
|
||||||
<InstancedMesh ref="imesh" material="material" :count="NUM_INSTANCES">
|
|
||||||
<BoxGeometry :width="2" :height="2" :depth="10"></BoxGeometry>
|
|
||||||
</InstancedMesh>
|
|
||||||
</Scene>
|
|
||||||
</Renderer>
|
|
||||||
```
|
|
||||||
|
|
||||||
## GLTF
|
## GLTF
|
||||||
|
|
||||||
Take a look at [DemoGLTF.vue](/src/components/demos/DemoGLTF.vue).
|
Take a look at [DemoGLTF.vue](/src/components/demos/DemoGLTF.vue).
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<GLTFViewer src="test.glb" :camera-position="{ z: 1 }">
|
<GLTFViewer src="test.glb" :camera-position="{ z: 1 }">
|
||||||
<AmbientLight></AmbientLight>
|
<AmbientLight />
|
||||||
</GLTFViewer>
|
</GLTFViewer>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user