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

@@ -128,10 +128,7 @@ var phoneObj = "data:model/obj;base64,IyAzZHMgTWF4IFdhdmVmcm9udCBPQkogRXhwb3J0ZX
var script = {
name: 'Mockup',
props: {
screenImg: {
type: String,
},
video: {
screen: {
type: null,
},
lightClr: {
@@ -185,11 +182,11 @@ var script = {
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();