LoginSignup
1
1

More than 3 years have passed since last update.

【Aframe】Aframe星型パーティクルを試してみた

Last updated at Posted at 2020-02-02

⭐️Mac OS Mojave バージョン10.14
⭐️iPhone7(IOS 12.3.1)

↓↓完成動画

aframe-particle-system-component
https://www.npmjs.com/package/aframe-particle-system-component

スクリーンショット 2020-02-02 16.18.01.png

2020.02.02時点で、最新バージョンは「1.1.3」

https://unpkg.com/browse/aframe-particle-system-component@1.1.3/
スクリーンショット 2020-02-02 16.21.16.png

下記を組み込めばOK

<script src="https://unpkg.com/aframe-particle-system-component@1.1.3/dist/aframe-particle-system-component.min.js"></script> 

パーティクルの設定は
スクリーンショット 2020-02-02 16.27.05.png

パーティクルの種類を星型「star」に設定して、星の色をピンクに設定。

<a-entity particle-system="preset:star; color: #f216b0,#f24535"></a-entity>

スクリーンショット 2020-02-02 16.34.44.png

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Hello, WebVR!  A-Frame</title>
    <meta name="description" content="Hello, WebVR! • A-Frame">
    <script src="https://aframe.io/releases/1.0.3/aframe.min.js"></script>
    <script src="https://unpkg.com/aframe-particle-system-component@1.1.3/dist/aframe-particle-system-component.min.js"></script>
  </head>
  <body>
    <a-scene>
      <a-sky rotation="0 -90 0" src="SkyBox.png"></a-sky>
      <a-entity rotation="0 90 0" position="0 -5 -10" particle-system="preset:star; color: #f216b0,#f24535"></a-entity>
      <a-image src="girl.png" width="4" height="4" position="0 -0.2 -5"></a-image>
    </a-scene>
  </body>
</html>
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1