You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm coming over from babylon - hoping this library can be more performant and it looks to be!
I need to build my own custom meshes and i found your triangle example. I've tried adding to it without much success.
does the position.fromArray calculate the normals ?
is there other ways of specifying geometry
why is the model black in my example?
thanks for pushing me in the right direction!!!!
var TRIANGLE_POSITIONS = [
[-0.5, -0.5, 0],
[0.5, -0.5, 0],
[0, 0.5, 0],
[0.5, -0.5, 0],
[0, 0.5, -1],
[0, 0.5, 0],
];
clay.application.create("#main", {
width: window.innerWidth,
height: window.innerHeight,
init: function (app) {
var camera = app.createCamera([6, 15, 15], [0, 0, 0]);
// Create a empty geometry and set the triangle vertices
var geometry = new clay.StaticGeometry();
geometry.attributes.position.fromArray(TRIANGLE_POSITIONS);
var mesh = app.createMesh(geometry, {
shader: 'clay.lambert'
});
mesh.material.set('color', 'blue');
// Create lights.
var directionalLight = app.createDirectionalLight([10, 10, 10]);
directionalLight.shadowResolution = 1024;
this._pointLight = app.createPointLight([30, 30, 0], 100, '#fff', 1);
this._control = new clay.plugin.OrbitControl({
target: camera,
domElement: app.container
});
},
loop: function (app) {
this._control.update(app.deltaTime);
}
});
The text was updated successfully, but these errors were encountered:
Hi, I'm coming over from babylon - hoping this library can be more performant and it looks to be!
I need to build my own custom meshes and i found your triangle example. I've tried adding to it without much success.
thanks for pushing me in the right direction!!!!
The text was updated successfully, but these errors were encountered: