vue threejs_基于基于Threejs和Panolens的Vue构建VR应用程序的框架

Vue VR是一个基于Threejs和Panolens的框架,用于构建VR应用程序,灵感来源于react-vr。该框架提供了从简单全景图到360度视频的VR体验。通过npm或直接引入js文件进行安装,然后使用webpack构建并在本地运行。
摘要由CSDN通过智能技术生成

vue threejs

Vue VR (Vue VR)

A framework for building VR applications with Vue based on threejs and Panolens, inspired by react-vr.

受react-vr启发,使用基于threejs和Panolens的Vue构建VR应用程序的框架。

入门 (Getting started)

using npm

使用npm

npm install vuejs-vr --save

Or using script tag for global use

或使用脚本标签供全球使用

<script src="https://unpkg.com/[email protected]/dist/vue-vr.min.js"></script>

Or Download vue-vr.min.js and include it in your html

或下载vue-vr.min.js并将其包含在您的html中

在本地安装和运行 (Installing & Running Locally)

Clone the repository using git:

使用git克隆存储库:

git clone https://github.com/imudin/vue-vr.git

Installing all dependencies:

安装所有依赖项:

npm install

Build by webpack:

通过webpack构建:

npm run-script build

Run locally:

在本地运行:

npm start

This will start development server on localhost:8080

这将在本地主机上启动开发服务器:8080

用法 (Usage)

对于简单的全景图: (For simple panorama:)

Panorama by equirectangular image

等角影像全景图

<template>
    <Pano source="pano.jpg"></Pano>
</template>
<script>
    import { Pano } from 'vuejs-vr'

    export default {
        components: { Pano }
    }
</script>

Or

要么

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div id="app">
        <Pano src="pano.jpg"></Pano>
    </div>
    <script src="vue.js"></script>
    <script src="vuejs-vr.js"></script>
    <script>
        new Vue({
            el: '#app'
        })
    </script>
</body>
对于立方体面: (For cube faces:)

Panorama with a six-face cubemap

六面立方体贴图的全景

<template>
    <Pano type='cube 'source="pano_%s.jpg"></Pano>
</template>
<script>
    import { Pano } from 'vuejs-vr'

    export default {
        components: { Pano }
    }
</script>

Note: %s replaced by 'l'|'f'|'r'|'b'|'u'|'d' Or

注意: %s替换为'l'|'f'|'r'|'b'|'u'|'d'

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div id="app">
        <Pano type='cube 'source="pano_%s.jpg"></Pano>
    </div>
    <script src="vue.js"></script>
    <script src="vuejs-vr.js"></script>
    <script>
        new Vue({
            el: '#app'
        })
    </script>
</body>
360度影片: (360 video:)

Panorama with 360 video

具有360度视频的全景

<template>
    <Pano type='video 'source="video.mp4"></Pano>
</template>
<script>
    import { Pano } from 'vuejs-vr'

    export default {
        components: { Pano }
    }
</script>

Or

要么

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div id="app">
        <Pano type='video 'source="video.mp4"></Pano>
    </div>
    <script src="vue.js"></script>
    <script src="vuejs-vr.js"></script>
    <script>
        new Vue({
            el: '#app'
        })
    </script>
</body>

待办事项清单 (TODO List)

  • Hotspots

    热点地区

  • 3D objects

    3D物件

翻译自: https://vuejsexamples.com/a-framework-for-building-vr-applications-with-vue-based-on-threejs-and-panolens/

vue threejs

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值