-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[glTF loader] Fix model with vertex color of size 3.
- Loading branch information
Showing
3 changed files
with
445 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,49 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<script src="../dist/claygl.js"></script> | ||
<title>Model loading</title> | ||
</head> | ||
<body> | ||
<style> | ||
html, body, #main { | ||
height: 100%; | ||
margin: 0; | ||
} | ||
</style> | ||
<div id="main"></div> | ||
<script> | ||
var app = clay.application.create('#main', { | ||
init: function (app) { | ||
// Create camera | ||
this._camera = app.createCamera([0, 2, 100], [0, 0, 0]); | ||
|
||
// Create light | ||
app.createDirectionalLight([-1, -1, -1]); | ||
|
||
// Use orbit control | ||
this._control = new clay.plugin.OrbitControl({ | ||
target: this._camera, | ||
domElement: app.container | ||
}); | ||
|
||
// Load boombox model. return a load promise to make sure the look will be start after model loaded. | ||
return app.loadModel('./assets/models/VoxelCorgi.gltf', { | ||
waitTextureLoaded: true | ||
}); | ||
}, | ||
|
||
loop: function (app) { | ||
this._control.update(app.frameTime); | ||
} | ||
}); | ||
|
||
window.onresize = function () { | ||
app.resize() | ||
}; | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.