First commit
This commit is contained in:
96
start.html
Executable file
96
start.html
Executable file
@@ -0,0 +1,96 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Kepler</title>
|
||||
<script src="media/libs/jquery/jquery.js"></script>
|
||||
</head>
|
||||
<script>
|
||||
var kepler;
|
||||
var gl;
|
||||
var gl2;
|
||||
</script>
|
||||
<script type="module">
|
||||
|
||||
import keplerEngine from './engine/kepler.js';
|
||||
import entity from './engine/entity.js';
|
||||
import material from './engine/material.js';
|
||||
import sampler2D from './engine/sampler2D.js';
|
||||
import samplerCube from './engine/samplerCube.js';
|
||||
|
||||
import mesh from './engine/mesh.js';
|
||||
import viewport from './engine/viewport.js';
|
||||
import {matrix4} from './engine/math.js';
|
||||
import template from './engine/renderPasses/template.js';
|
||||
import scene from './engine/scene.js';
|
||||
|
||||
kepler = new keplerEngine();
|
||||
|
||||
var ViewPort = new viewport("keplerEngine");
|
||||
|
||||
//kepler.assimpLoader.load( "demo.json", ViewPort.scene );
|
||||
|
||||
var light = new entity( );
|
||||
|
||||
light.name = "skylight";
|
||||
light.transform.position = [0, 18.1, -10.01];
|
||||
light.type = "skyLight";
|
||||
//light.type = "pointLight";
|
||||
light.transform.direction = [0, -4, -0.01];
|
||||
light.showFrustum = true;
|
||||
light.degrees = 70;
|
||||
|
||||
|
||||
ViewPort.scene.addEntity( light );
|
||||
|
||||
|
||||
kepler.addViewport( ViewPort );
|
||||
|
||||
|
||||
|
||||
// Material
|
||||
var groundMaterial = new material();
|
||||
|
||||
// Samplers
|
||||
var normalTexture = kepler.resources.getTexture("0_floorTiles_ddn.png");
|
||||
var normalSampler = new sampler2D();
|
||||
normalSampler.addTexture(normalTexture);
|
||||
|
||||
var diffuseTexture = kepler.resources.getTexture("0_floorTiles_diff.png");
|
||||
var diffuseSampler = new sampler2D();
|
||||
diffuseSampler.addTexture(diffuseTexture);
|
||||
|
||||
groundMaterial.addTexture(diffuseSampler);
|
||||
groundMaterial.addNormal(normalSampler);
|
||||
//groundMaterial.addRoughness(normalSampler);
|
||||
|
||||
// Properties
|
||||
groundMaterial.diffuseColor = [179/256,199/256,217/256];
|
||||
groundMaterial.alpha = 1;
|
||||
groundMaterial.reflection = 0.2;
|
||||
groundMaterial.roughness = 0.2;
|
||||
groundMaterial.metalic = 0.2;
|
||||
groundMaterial.uvMultiplier = 6;
|
||||
|
||||
// Cube mesh
|
||||
var cubeMesh = ViewPort.primitives.createCube(10);
|
||||
|
||||
cubeMesh.addMaterial(groundMaterial);
|
||||
|
||||
// Cube Entity
|
||||
var cubeEntity = new entity( );
|
||||
cubeEntity.addMesh( cubeMesh );
|
||||
cubeEntity.name = "wireframe cube";
|
||||
cubeEntity.transform.position = [0, -10, 0];
|
||||
cubeEntity.transform.update();
|
||||
|
||||
ViewPort.scene.addEntity( cubeEntity );
|
||||
|
||||
|
||||
kepler.application();
|
||||
|
||||
</script>
|
||||
<body style="margin: 0; padding: 0;">
|
||||
<img src="media/textures/logo.png" style="position: absolute;left:0; top:10px;" >
|
||||
<canvas id="keplerEngine" style="width: 100%; height: 100%; float:left;"></canvas>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user