Skip to main content

No project description provided

Project description

A-FRAME

An easy-to-use python wrapper for the A-Frame web framework.

pip install aframe

What is A-Frame?

A-Frame is a web framework for building virtual reality (VR) experiences. A-Frame is based on top of HTML, making it simple to get started. But A-Frame is not just a 3D scene graph or a markup language; the core is a powerful entity-component framework that provides a declarative, extensible, and composable structure to three.js.

Originally conceived within Mozilla and now maintained by the co-creators of A-Frame within Supermedium, A-Frame was developed to be an easy yet powerful way to develop VR content. As an independent open source project, A-Frame has grown to be one of the largest VR communities.

A-Frame supports most VR headsets such as Vive, Rift, Windows Mixed Reality, Daydream, GearVR, Cardboard, Oculus Go, and can even be used for augmented reality. Although A-Frame supports the whole spectrum, A-Frame aims to define fully immersive interactive VR experiences that go beyond basic 360° content, making full use of positional tracking and controllers.

Example

Here is an example using the Aframe library with FastAPI to create a VR Hello World:

from aframe import Aframe, xyz
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
import uvicorn

app = FastAPI()

@app.get('/')
def hello_world():
    a = Aframe()
    a.set_scene(background="color: #ECECEC")
    a.box(position=xyz(-1, 0.5, -3), rotation=xyz(0, 45, 0), 
          color="#4CC3D9", shadow=True)
    a.sphere(position=xyz(0, 1.25, -5), radius=1.25, 
             color="#EF2D5E", shadow=True)
    a.cylinder(position=xyz(1, 0.75, -3), radius=0.5, 
               height=1.5, color="#FFC65D", shadow=True)
    a.plane(position=xyz(0, 0.1, -4), rotation=xyz(-90, 0, 0), 
            width=4, height=4, color="#7BC8A4")
    return HTMLResponse(a.generate())

if __name__ == '__main__':
    uvicorn.run("main:app", port=8000, log_level="info", reload=True)

For a more involved example, run the following in a script file:

from aframe.templates import fastapi
fastapi()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aframe-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

aframe-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file aframe-0.1.0.tar.gz.

File metadata

  • Download URL: aframe-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.5 Windows/10

File hashes

Hashes for aframe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 843cbfd17b2773bdaba6b3ffdb56818b36e825e9f10e5594f4bca53b5719161b
MD5 e928ad663f553ba8e8689a7bd8c8b331
BLAKE2b-256 f8698aa959b2c31b850405face02a9bacf074396db0456525feca740938e1330

See more details on using hashes here.

File details

Details for the file aframe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aframe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.5 Windows/10

File hashes

Hashes for aframe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc1f08bbb647d195c021bbd50cbdfdbc7f40bc0d6accd2331b5a03999dc2bdfa
MD5 ed5a37d57225a39c8bd4974555c96867
BLAKE2b-256 554222de7832e4f2c9dcf97299af6d34de7d9fab687d008e3063acbcca2e14b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page