user10184297
user10184297

Reputation: 81

Making a 360 degree view of an image in html and javascript

I am trying to make a 360 degree view of an image using html. My sample code is given below:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Panorama</title>
    <meta name="description" content="Panorama — A-Frame">
    <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>

<body>
    <a-scene>
        <a-sky src="images/gallery/pan0.png" rotation="0 -130 0"></a-sky>
    </a-scene>
</body>

</html>

The problem is, when I run the code, nothing is showing. Is there any way to solve this?

Upvotes: 3

Views: 2561

Answers (1)

Ravi Kundu
Ravi Kundu

Reputation: 45

I have made changes to the code.Try this code this should work :

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Panorama</title>
    <meta name="description" content="Panorama — A-Frame">
    <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>
<body>
    <a-scene>
        <a-assets>
            <img id="panorama" src="images/gallery/pan0.png"/>
        </a-assets>
        <a-sky src="#panorama" rotation="0 -130 0"></a-sky>
    </a-scene>
</body>
</html>

Upvotes: 1

Related Questions