mirror of
https://github.com/anatolykopyl/vue-three-d-mockup.git
synced 2026-03-26 12:55:08 +00:00
Single screen prop
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
<Mockup
|
||||
v-if="vidReady"
|
||||
class="mockup"
|
||||
:video="$refs.video"
|
||||
:screen="$refs.video"
|
||||
/>
|
||||
<Mockup
|
||||
class="mockup"
|
||||
screenImg="screen.png"
|
||||
screen="screen.png"
|
||||
:rotation="{
|
||||
x: -0.2,
|
||||
y: -0.3,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user