Coder Social home page Coder Social logo

Comments (3)

ngokevin avatar ngokevin commented on May 18, 2024

You could just use a normal <a-sky> DOM element.

If you're interested, here's how <a-sky> is composed: https://github.com/aframevr/aframe/blob/master/src/extras/primitives/primitives/a-sky.js

from aframe-react.

CasperHK avatar CasperHK commented on May 18, 2024

But if I want to use aframe-react lib to implement <a-sky>? How can I make it? Or, I better use aframe lib directly?

from aframe-react.

HelrenPDM avatar HelrenPDM commented on May 18, 2024

Hi Casper,

create a component that takes an input property of the image source
(either a URL, or if you use the asset management system
(https://aframe.io/docs/0.2.0/core/asset-management-system.html) an
element selector).

In the componentrender function, you return an aframe-react Entity with
a spherical geometry. Very basic would look like:

++++

import React from 'react';
import { Entity } from 'aframe-react';

const {
Component,
PropTypes,
} = React;

export class SkySample extends Component {
render() {
return (
<Entity
geometry={{ primitive: 'sphere', radius: 5000 }}
material={{ src: this.props.src }}
scale={"1 1 -1"}
/>
);
}
}

SkySample.propTypes = {
src: PropTypes.string.isRequired,
};

export default SkySample;

++++

Whatever you additionally want to define, you can find in the documents.
Like setting transparency to play with opacity and animations to fade it
in and out.

hth,

Stephan

Am 11/07/16 um 14:02 schrieb Casper LI:

But if I want to use in |aframe-react| lib. How can I make it? Or, I
better use |aframe| lib directly?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#29 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADx4uX8-dIi1kVDlRCtbjxBW4CumnI7Hks5qUjDbgaJpZM4JJAhZ.

_Stephan

from aframe-react.

Related Issues (20)

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.