Skip to content

akbartus/A-Frame-Component-Lenticular-Image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A-Frame-Component-Lenticular-Image

Video screen capture

Description / Rationale

This is A-Frame component for creating lenticular image effects in AR and VR. The original source code was taken from YCW's Codepen Repository and with various modifications was adapted to the A-Frame's environment.

Instructions

In order to use the component attach "lenticular-image" to a-entity. The component has the following attributes:

  • img1: { type: "string", default: "" } - URL to first image.
  • img2: { type: "string", default: "" } - URL to second image.

The code below shows the sample implementation of the component:

<html>
<head>
    <title>A-Frame Component: Lenticular Image</title>
    <script src='https://aframe.io/releases/1.4.2/aframe.min.js'></script>
    <script src="js/lenticular-image-component.js"></script>
</head>
<body>
    <a-scene>
        <a-entity lenticular-image="img1: img/image3.jpg; img2: img/image4.jpg" scale="0.5 0.5 0.5" position="0 1 -2"></a-entity>
        <a-entity lenticular-image="img1: img/image1.jpg; img2: img/image2.jpg" scale="0.5 0.5 0.5" position="2 1 -2"></a-entity>
        <a-sky color='#ECECEC'></a-sky>
    </a-scene>
</body>
</html>

Tech Stack

The project is powered by AFrame and Three.js. The all four images used were taken from Unsplash.com: image 1, image 2, image 3, image 4.

Demo

See demo of the component here: Demo

About

A-Frame component for creating lenticular image effects in AR and VR

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors