Giter Club home page Giter Club logo

aframe's Introduction

一个框架

一个框架

用于构建虚拟现实体验的 Web 框架。

覆盖状态 下载 版本 执照

例子

超级飞船

画家

超中等 一个爆炸

A-周六晚上

音乐森林@googlecreativelab

在主页A Week of A-FrameWebVR Directory上可以找到更多示例。

特征

👓虚拟现实变得简单:A-Frame 只需放入<a-scene>.

❤️声明性 HTML:HTML 易于阅读和复制粘贴。由于 A-Frame 可以通过 HTML 使用,因此每个人都可以使用 A-Frame:Web 开发人员、VR 和 AR 爱好者、教育工作者、艺术家、创客、孩子。

🔌实体组件架构:A-Frame 是一个基于 Three.js 的强大框架,为 Three.js 提供声明性、可组合、可重用的实体组件结构。虽然 A-Frame 可以通过 HTML 使用,但开发人员可以无限制地访问 JavaScript、DOM API、 Three.js、WebXR 和 WebGL。

性能:A-Frame 是一个基于 Three.js 的瘦框架。虽然A-Frame使用了DOM,但A-Frame并不触及浏览器布局引擎。性能是重中之重,需要在高度交互的 WebXR 体验上进行实战测试。

🌐跨平台:为任何与支持 WebXR 的浏览器兼容的耳机构建 VR 和 AR 应用程序。没有耳机或控制器?没问题!A-Frame 仍然适用于标准台式机和智能手机。

🔍 Visual Inspector:A-Frame 提供了内置的视觉 3D 检查器,其工作流程类似于浏览器的开发工具,界面类似于 Unity。打开任何 A-Frame 场景并点击<ctrl> + <alt> + i

🏃功能:使用 A-Frame 的内置组件(例如几何图形、材质、灯光、动画、模型、光线投射器、阴影、位置音频、跟踪控制器)立即开始运行。利用粒子系统、物理、多用户、海洋、山脉、语音识别或隐形传态等社区组件,走得更远!

用法

例子

只需几行 HTML 即可在浏览器中构建 VR 和 AR 场景!要立即开始播放和发布,请重新混合入门示例:

混音 叉

<html>
  <head>
    <script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
  </head>
  <body>
    <a-scene>
      <a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
      <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
      <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
      <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
      <a-sky color="#ECECEC"></a-sky>
    </a-scene>
  </body>
</html>

借助 A-Frame 的实体组件架构,我们可以从生态系统(例如海洋、物理)中放入社区组件,并将它们直接从 HTML 插入到我们的对象中:

混音 叉

<html>
  <head>
    <script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
    <script src="https://unpkg.com/[email protected]/dist/aframe-particle-system-component.min.js"></script>
    <script src="https://unpkg.com/aframe-extras.ocean@%5E3.5.x/dist/aframe-extras.ocean.min.js"></script>
    <script src="https://unpkg.com/[email protected]/dist/gradientsky.min.js"></script>
  </head>
  <body>
    <a-scene>
      <a-entity id="rain" particle-system="preset: rain; color: #24CAFF; particleCount: 5000"></a-entity>
  <span class="pl-kos">&lt;</span><span class="pl-ent">a-entity</span> <span class="pl-c1">id</span>="<span class="pl-s">sphere</span>" <span class="pl-c1">geometry</span>="<span class="pl-s">primitive: sphere</span>"
            <span class="pl-c1">material</span>="<span class="pl-s">color: #EFEFEF; shader: flat</span>"
            <span class="pl-c1">position</span>="<span class="pl-s">0 0.15 -5</span>"
            <span class="pl-c1">light</span>="<span class="pl-s">type: point; intensity: 5</span>"
            <span class="pl-c1">animation</span>="<span class="pl-s">property: position; easing: easeInOutQuad; dir: alternate; dur: 1000; to: 0 -0.10 -5; loop: true</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">a-entity</span><span class="pl-kos">&gt;</span>

  <span class="pl-kos">&lt;</span><span class="pl-ent">a-entity</span> <span class="pl-c1">id</span>="<span class="pl-s">ocean</span>" <span class="pl-c1">ocean</span>="<span class="pl-s">density: 20; width: 50; depth: 50; speed: 4</span>"
            <span class="pl-c1">material</span>="<span class="pl-s">color: #9CE3F9; opacity: 0.75; metalness: 0; roughness: 1</span>"
            <span class="pl-c1">rotation</span>="<span class="pl-s">-90 0 0</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">a-entity</span><span class="pl-kos">&gt;</span>

  <span class="pl-kos">&lt;</span><span class="pl-ent">a-entity</span> <span class="pl-c1">id</span>="<span class="pl-s">sky</span>" <span class="pl-c1">geometry</span>="<span class="pl-s">primitive: sphere; radius: 5000</span>"
            <span class="pl-c1">material</span>="<span class="pl-s">shader: gradient; topColor: 235 235 245; bottomColor: 185 185 210</span>"
            <span class="pl-c1">scale</span>="<span class="pl-s">-1 1 1</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">a-entity</span><span class="pl-kos">&gt;</span>

  <span class="pl-kos">&lt;</span><span class="pl-ent">a-entity</span> <span class="pl-c1">id</span>="<span class="pl-s">light</span>" <span class="pl-c1">light</span>="<span class="pl-s">type: ambient; color: #888</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">a-entity</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">a-scene</span><span class="pl-kos">&gt;</span>

</body> </html>

构建

要使用 A-Frame 的最新稳定版本,请包括aframe.min.js

<head>
  <script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
</head>

要查看稳定版本和主版本,请参阅dist/文件夹

新项目管理

npm install --save aframe
# Or yarn add aframe
require('aframe')  // e.g., with Browserify or Webpack.

本地发展

git clone https://github.com/aframevr/aframe.git  # Clone the repository.
cd aframe && npm install  # Install dependencies.
npm start  # Start the local development server.

并在浏览器中打开http://localhost:9000

生成构建

npm run dist

问题

如需问题和支持,请在 StackOverflow 上提问

保持联系

并与维护人员取得联系!

贡献

参与其中!查看贡献指南以了解如何开始。

您还可以购买一件具有独特设计的华丽 A 形 T 恤来支持开发

执照

该程序是免费软件,并根据MIT 许可证分发。

aframe's People

Contributors

supermediumbot avatar ngokevin avatar dmarcos avatar cvan avatar donmccurdy avatar machenmusik avatar vincentfretin avatar fernandojsg avatar darkwing avatar nylki avatar takahirox avatar diarmidmackenzie avatar caseyyee avatar mkungla avatar adarosecannon avatar mrxz avatar digitec avatar brianpeiris avatar benjaminleonard avatar wmurphyrd avatar utopiah avatar mattdesl avatar meta-meta avatar arpu avatar cemkod avatar rspace avatar dirkk0 avatar mqp avatar msimpson avatar thoragio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.