mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 12:22:03 +08:00
27 lines
503 B
JavaScript
27 lines
503 B
JavaScript
|
import { PerspectiveCamera, Vector3 } from 'three';
|
||
|
|
||
|
import { setFromProp } from '../tools.js';
|
||
|
|
||
|
export default {
|
||
|
inject: ['three'],
|
||
|
props: {
|
||
|
fov: {
|
||
|
type: Number,
|
||
|
default: 50,
|
||
|
},
|
||
|
position: Object,
|
||
|
// position: {
|
||
|
// type: Object,
|
||
|
// default: new Vector3(),
|
||
|
// },
|
||
|
},
|
||
|
created() {
|
||
|
const camera = new PerspectiveCamera(this.fov);
|
||
|
setFromProp(camera.position, this.position);
|
||
|
this.three.camera = camera;
|
||
|
},
|
||
|
render() {
|
||
|
return [];
|
||
|
},
|
||
|
};
|