Skip to content

Commit

Permalink
remove all extra assets and clear up for init release on YouTube
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoyu Hou authored and Xiaoyu Hou committed Feb 24, 2024
1 parent 40e93a8 commit 0f7377a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 179 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Babylon Hugh Hou</title>
<title>360 Photo and Video Viewer by Hugh Hou (WebXR for Vision Pro)</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="styles.css" />

Expand Down
83 changes: 1 addition & 82 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Engine,
Scene,
Vector3,
HemisphericLight,
Texture,
PhotoDome,
VideoDome,
Expand Down Expand Up @@ -44,7 +43,6 @@ const scene = new Scene(engine);
//var xrHelper = scene.createDefaultXRExperienceAsync();
//var vrHelper = scene.createDefaultVRExperience();
var vrHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera:false});
//new HemisphericLight("hemiLight", new Vector3(0, 1, 0));

const camera = new UniversalCamera(
"camera",
Expand Down Expand Up @@ -75,19 +73,6 @@ var dome = new PhotoDome(
);
dome.imageMode = PhotoDome.MODE_MONOSCOPIC;

// Create the VideoDome
// var videoDome = new VideoDome(
// "videoSphere",
// lakeTahao8k360video,
// {
// resolution: 64,
// size: 1000,
// clickToPlay: true,
// useDirectMapping: false
// },
// scene
// );
//videoDome.imageMode = VideoDome.MODE_TOPBOTTOM;
vrHelper.enableInteractions();

// Create a GUI texture
Expand Down Expand Up @@ -261,17 +246,6 @@ const loadNewVideoTexture = (video) => {
newTexture.onLoadObservable.add(() => {
dome.dispose();

// Create a new dome with the new texture
// dome = new PhotoDome(
// "sphere",
// image,
// {
// resolution: 128,
// size: 1000,
// useDirectMapping: false
// },
// scene
// );
// Create the VideoDome
dome = new VideoDome(
"videoSphere",
Expand Down Expand Up @@ -322,62 +296,7 @@ fadeInAnimation.setKeys([
{ frame: 0, value: 0 },
{ frame: 120, value: 1 }
]);
//Assume `scene` is your Babylon.js scene

// Create the zoom in button
// var zoomInButton = Button.CreateSimpleButton(
// "zoomInButton",
// "Zoom In"
// );
// zoomInButton.paddingTopInPixels = 50;
// zoomInButton.width = "100px";
// zoomInButton.height = "90px";
// zoomInButton.color = "white";
// zoomInButton.background = "blue";
// zoomInButton.onPointerUpObservable.add(() => {
// camera.fov = Math.max(0.1, camera.fov - 0.1);
// });
// stackPanel.addControl(zoomInButton);

// Create the zoom out button
// var zoomOutButton = Button.CreateSimpleButton(
// "zoomOutButton",
// "Zoom Out"
// );
// zoomOutButton.width = "100px";
// zoomOutButton.height = "40px";
// zoomOutButton.color = "white";
// zoomOutButton.background = "blue";
// zoomOutButton.onPointerUpObservable.add(() => {
// camera.fov = Math.min(Math.PI / 2, camera.fov + 0.1);
// });
// stackPanel.addControl(zoomOutButton);

// Create a rotation animation
// let isRotationPlaying = true;
// let rotationSpeed = 0.00001; // Adjust as needed for faster/slower rotation

// Create the rotation button
// const rotationButton = Button.CreateSimpleButton(
// "rotationButton",
// "Pause"
// );
// rotationButton.width = "100px";
// rotationButton.height = "40px";
// rotationButton.color = "white";
// rotationButton.background = "purple";
// rotationButton.onPointerUpObservable.add(() => {
// isRotationPlaying = !isRotationPlaying;
// rotationButton.textBlock.text = isRotationPlaying
// ? "Pause"
// : "Play";
// });
// stackPanel.addControl(rotationButton);

// Update camera rotation in the render loop based on isRotationPlaying
// scene.onBeforeRenderObservable.add(() => {
// //dome.imageMode = PhotoDome.MODE_SIDEBYSIDE;
// // if (isRotationPlaying) {
// // camera.rotation.y += rotationSpeed;
// // }
//
// });
96 changes: 0 additions & 96 deletions style.css

This file was deleted.

0 comments on commit 0f7377a

Please sign in to comment.