Adding skybox example

This commit is contained in:
Program Sam 2025-11-24 16:53:21 +01:00 committed by GitHub
parent 0d633f0c60
commit 8829440dd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 51 additions and 0 deletions

BIN
sandbox/skyBox/nx.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

BIN
sandbox/skyBox/ny.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
sandbox/skyBox/nz.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

BIN
sandbox/skyBox/px.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

BIN
sandbox/skyBox/py.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
sandbox/skyBox/pz.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>OpenGlobus SkyBox Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="./skyBox.js" type="module"></script>
<link rel="stylesheet" href="../../css/og.css" type="text/css" />
<style>
body {
padding: 0;
margin: 0;
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<div id="earth" style="position: absolute; width: 100%; height: 100%"></div>
</body>
</html>

28
sandbox/skyBox/skyBox.js Normal file
View File

@ -0,0 +1,28 @@
import {
Globe,
LonLat,
OpenStreetMap,
scene,
control
} from "../../lib/og.es.js";
const skybox = new scene.SkyBox({
px: "./px.webp",
nx: "./nx.webp",
py: "./py.webp",
ny: "./ny.webp",
pz: "./pz.webp",
nz: "./nz.webp"
});
const globus = new Globe({
target: "earth",
name: "Earth",
layers: [new OpenStreetMap()],
atmosphereEnabled: true,
skybox: skybox,
controls: [
new control.MouseNavigation({ minSlope: 0.35 }),
new control.KeyboardNavigation({ autoActivate: true })
]
})