Mozilla开源了VR框架A-Frame

Mozilla创建并开源了A-Frame,这是一个用于在桌面浏览器、智能手机和Oculus Rift上创建VR场景的框架。

\\

A-Frame是一个在浏览器中创建VR体验的开源框架。该框架由Mozilla的MozVR团队创建和开发。A-Frame使用了一个在游戏开发中经常使用的“实体-组件(Entity-component)”系统,其中,实体是放置在场景中的对象,而组件是与那些实体相关的属性。实体使用HTML标签定义,而组件则基于一种类似CSS语法的HTML属性。实体需要置入一个场景,其中包含了VR中需要渲染的一切内容。

\\

下面的示例代码描绘了一个边长为1米的红盒子实体(立方体):

\\
\u0026lt;a-scene\u0026gt;\   \u0026lt;a-entity geometry=\"primitive: box; width: 1\" material=\"color: red\"\u0026gt;\u0026lt;/a-entity\u0026gt;\\u0026lt;/a-scene\u0026gt;
\\

目前,geometry组件支持下列primitiveboxcirclecylinderplaneringspheretorustorusKnot。其他组件包括:cameralightsoundfogmaterialscale,等等。实体可以关联多个组件创建更复杂的场景,像下面的示例代码这样:

\\
\u0026lt;a-entity geometry=\"primitive: cube; depth: 1; height: 1; width: 1\"\          material=\"color: pink\"\          light=\"intensity: 2\"\          position=\"-1 5 0\"\          sound=\"src: dangerzone.mp3; volume: 2\"\u0026gt;\\u0026lt;/a-entity\u0026gt;
\\

为了简化开发人员的工作,Mozilla封装了一些实体-组件元素,创建了若干语法更简单易用的原语。如下所示,这行代码描绘了与上文相同的正方体:

\\
\u0026lt;a-cube width=\"1\" color=\"red\"\u0026gt;\u0026lt;/a-cube\u0026gt;
\\

预定义的原语包括:a-cameraa-cylindera-planea-spherea-lighta-skya-imagea-video,等等。a-model让开发人员可以在场景中加载OBJ或DAE 3D模型资产。

\\

动画是虚拟现实渲染的重要组成部分。A-Frame内部使用基于Web动画规范的tween.js。下面的这段代码实现了一个男人的旋转模型:

\\
\u0026lt;a-entity id=\"model\" position=\"0 0 -2\"\u0026gt;\   \u0026lt;a-animation attribute=\"rotation\" from=\"0 -30 0\" to=\"0 330 0\" dur=\"15000\" easing=\"linear\" repeat=\"inifite\"\u0026gt;\u0026lt;/a-animation\u0026gt;\   \u0026lt;a-model position=\"-.35 0 .55\" rotation=\"0 -20 0\" scale=\"1.5 1.5 1.5\" src="../_models/man/man.dae"\u0026gt;\u0026lt;/a-model\u0026gt;\\u0026lt;/a-entity\u0026gt;
\\

A-Frame可以用于主流的桌面浏览器中,场景受鼠标或键盘控制,也可以用于智能手机和Oculus Rift头戴设备上。有个问题是,某些特定的场景在部分Android设备上不能正常渲染,但这个问题很快就会被修复。Mozilla创建了若干展示这项技术的演示程序。感兴趣的读者可以从GitHub上下载A-Frame的源代码。

\\

查看英文原文:Mozilla Has Created A-Frame, a VR Framework

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543806.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

css网格_CSS网格容器

css网格CSS | 网格容器 (CSS | Grid Containers) There are numerous ways to display our list items or elements. For instance, we can display them in the navigation bar, in a menu bar and whatnot. Well, it would be right to say that there are many more such me…

c ++向量库_在C ++中对2D向量进行排序

c 向量库As per as a 2D vector is concerned its a vector of a 1D vector. But what we do in sorting a 1D vector like, 就2D向量而言,它是1D向量的向量 。 但是我们在对一维向量进行排序时所做的工作 sort(vector.begin(),vector.end());We cant do the same …

监听文本框数据修改,特别是微信等客户端直接选择粘贴修改

2019独角兽企业重金招聘Python工程师标准>>> // 手机号码信息加载验证 $(input).bind(input propertychange, function() { initPage.checkName(); }); 转载于:https://my.oschina.net/u/1579617/blog/550488

SSIA的完整形式是什么?

SSIA:主题说明一切 (SSIA: Subject Says It All) SSIA is an abbreviation of "Subject Says It All". SSIA是“主题说明一切”的缩写。 It is an expression, which is commonly used in the Gmail platform. It is written in the subject of the mail…

服务器控件转换成HTML

服务器控件转换成HTML<asp:Label ID"Label1" runat"server" Text"I am label"><asp:Literal ID"Literal1" runat"server" Text"I am a literal"><asp:Panel ID"Panel1" runat"serv…

Eratosthenes筛

什么是Eratosthenes筛&#xff1f; (What is Sieve of Eratosthenes?) Sieve of Eratosthenes is an ancient algorithm of finding prime numbers for any given range. Its actually about maintaining a Boolean table to check for corresponding prime no. Eratosthenes的…

微信iOS多设备多字体适配方案总结

一、背景 2014下半年&#xff0c;微信iOS版先后适配iPad, iPhone6/6plus。随着这些大屏设备的登场&#xff0c;部分用户觉得微信的字体太小&#xff0c;但也有很多用户不喜欢太大的字体。为了满足不同用户的需求&#xff0c;我们做了全局字体设置功能&#xff0c;在【设置-通用…

python矩阵中插入矩阵_Python | 矩阵的痕迹

python矩阵中插入矩阵The sum of diagonal elements of a matrix is commonly known as the trace of the matrix. It is mainly used in eigenvalues and other matrix applications. In this article, we are going to find the trace of a matrix using inbuilt function nu…

TOP命令监视系统任务及掩码umask的作用

top 命令使用方法及參数。 top 选择參数 參数&#xff1a; -b 以批量模式执行。但不能接受命令行输入&#xff1b;-c 显示命令行&#xff0c;而不不过命令名。-d N 显示两次刷新时间的间隔&#xff0c;比方 -d 5&#xff0c;表示两次刷新间隔为5秒&#xff1b;-i 禁止显示空暇…

python点线图_Python | 点线图

python点线图A mixture of dot and line plot is called a Dot-Line plot. Each dot is connected through a line and it is the next version of the line plot. It maintains the discrete property of the points and also represents the correlation between consecutive…

Android Studio导入工程的正确姿势

为什么80%的码农都做不了架构师&#xff1f;>>> 如果你有很好的网络环境 好的网络环境&#xff0c;这里不是指&#xff1a;我家网速带宽100M&#xff0c;电信的光纤接入。 而是&#xff1a;能翻墙。因为如果本机的gradle和将要导入的工程版本不匹配&#xff0c;Stu…

BBIAF的完整形式是什么?

BBIAF&#xff1a;回来几场 (BBIAF: Be Back In A Few) BBIAF is an abbreviation of "Be Back In A Few". BBIAF是“几回去”的缩写 。 It is an expression, which is commonly used in messaging or chatting on social media networking sites like Facebook, …

为什么年轻人挣得很多还是穷?北上广深挑战指数报告~

又是年底&#xff0c;又到了做选择的时候。从“激情燃烧的岁月”到“何处安放的青春”&#xff0c;逃离北上广深的口号从未停止过&#xff0c;回到北上广深的呼喊更是一浪接着一浪。应届生们奔波忙碌&#xff0c;想有一份承载自己梦想的工作&#xff0c;想在异乡有一处安身之所…

apple组织名称是什么_什么是Apple Macintosh?

apple组织名称是什么苹果Macintosh (Apple Macintosh) Steve Jobs and Steve Wozniak has founded the line of computers in the year 1984, on the date 24th January, named it Apple Macintosh. Macintosh is shortly abbreviated as Mac. In this, various versions of co…

什么是Apple Desktop Bus? 亚行代表什么?

亚行&#xff1a;Apple桌面总线 (ADB: Apple Desktop Bus) ADB is an abbreviation of "Apple Desktop Bus". ADB是“ Apple Desktop Bus”的缩写 。 It is a low-speed proprietary bit-serial peripheral bus connecting devices to computers. In 1986, it was l…

CentOS 创建SVN 服务器,并且自动同步到WEB 目录

CentOS 创建SVN 服务器&#xff0c;并且自动同步到WEB 目录 标签&#xff1a; centossvnsubversion服务器2013-12-06 10:09 5492人阅读 评论(0) 收藏 举报分类&#xff1a;linux&#xff08;5&#xff09; 一、安装Subversion #yum install subversion二&#xff0c;基本的SVN服…

TTYL的完整形式是什么?

TTYL&#xff1a;稍后再与您交谈 (TTYL: Talk To You Later) TTYL is an abbreviation of Talk To You Later. It is an internet slang that is most generally used in text messaging, instant messaging, and chatting on Facebook, Twitter, WhatsApp, etc. The acronym i…

zhilizhili-ui 2016始动 开始做个样例站吧 (一)

对 我又挖坑了 不过其实也不算挖坑 因为ui构建中就会有填坑的文章 之前一直在写《编写大型web页面 结合现有前端形势思考未来前端》这是一篇巨难写的文章 估计要到年中才能写好了 写作的过程中 发生了国内前端大撕逼 2015的尾声大战 是否可以宣告前端是否开始新的时代 2016年 国…

python 网格_Python | 网格到情节

python 网格Most of the time, we need good accuracy in data visualization and a normal plot can be ambiguous. So, it is better to use a grid that allows us to locate the approximate value near the points in the plot. It helps in reducing the ambiguity and t…

2016年1月计划

开始试着每月做计划和总结&#xff0c;有节奏的规划自己的时间&#xff0c;一月计划&#xff1a; 1、hive那本书拖了很久了&#xff0c;一月一定会看完。 2、因为跟着阚爷的风准备试着做一下讲师&#xff0c;分配给我的是推荐这块&#xff0c;所以网上多找找做推荐的资源&#…