Single screen prop

This commit is contained in:
2022-01-30 13:21:12 +03:00
parent 7e7335ef7c
commit e180ca28b5
4 changed files with 21 additions and 27 deletions

View File

@@ -19,10 +19,7 @@ import phoneObj from './assets/iphone.obj';
export default {
name: 'Mockup',
props: {
screenImg: {
type: String,
},
video: {
screen: {
type: null,
},
lightClr: {
@@ -76,11 +73,11 @@ export default {
let texture;
if (props.screenImg) {
if (typeof props.screen === 'string') {
const loader = new THREE.TextureLoader();
texture = loader.load(props.screenImg);
texture = loader.load(props.screen);
} else {
texture = new THREE.VideoTexture(props.video);
texture = new THREE.VideoTexture(props.screen);
}
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();