Comments (3)
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.
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.
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)
- Materials from url() are not loading HOT 2
- Question : is aframe-react stable HOT 2
- Question about 3d performances and react re-rendering on state change HOT 1
- Images from S3 HOT 1
- AltspaceVR React app is always 2D
- Integrate aframe-react with aframe-orbit-controls-component
- core:schema:warn Unknown property `0` for component/system
- How to use "AFRAME.registerGeometry"? HOT 1
- Changing loading-screen component on <Scene> has no effect
- Embedding scene in react application does not work HOT 2
- animation events
- wasd acceleration has no effect HOT 1
- @types HOT 3
- how to use raycaster in aframe-react? HOT 2
- Unable to render gltf model HOT 3
- Why is this image being loaded both by react and then by frame? HOT 1
- reverse mouse drag
- How to use loader with draco compression HOT 1
- how to use typescript HOT 2
- How to read the rotation and position of the camera HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aframe-react.