-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<html> | ||
<head> | ||
<title>Scene Test - Radio Map</title> | ||
<style> | ||
body { margin: 0; } | ||
canvas { width: 100%; height: 100% } | ||
</style> | ||
</head> | ||
<body> | ||
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r69/three.js"></script> | ||
--> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r69/three.min.js"></script> | ||
|
||
<script type="text/javascript"> | ||
var renderer = new THREE.WebGLRenderer( {antialiasing: true} ); | ||
renderer.setClearColor( 0x111111, 1 ); | ||
renderer.setSize( window.innerWidth, window.innerHeight ); | ||
document.body.appendChild( renderer.domElement ); | ||
|
||
var scene = new THREE.Scene(); | ||
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.01, 1000 ); | ||
|
||
camera.position.z = 1.5; | ||
|
||
var light = new THREE.AmbientLight( 0x888888 ); | ||
scene.add( light ); | ||
|
||
var light = new THREE.DirectionalLight( 0xcccccc, 1 ); | ||
light.position.set(5,3,5); | ||
scene.add( light ); | ||
|
||
var geometry = new THREE.SphereGeometry(0.5, 32, 32); | ||
var material = new THREE.MeshPhongMaterial(); | ||
var earthMesh = new THREE.Mesh(geometry, material); | ||
//material.map = THREE.ImageUtils.loadTexture('http://flatplanet.sourceforge.net/maps/images/earth.jpg'); | ||
scene.add(earthMesh); | ||
|
||
var render = function () { | ||
requestAnimationFrame( render ); | ||
|
||
renderer.render(scene, camera); | ||
}; | ||
|
||
render(); | ||
</script> | ||
</body> | ||
</html> |