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
I am trying to optimize my OBJ model using MergeVertices API. while checking for the parameters(modified indices, positions, uvs, normals) using xeogl.stats, It does update the stats, but wrongly, or abruptly(example : normals =65.3333).
Please see the code below.
function loadObj(objFile) {
var scene = xeogl.getDefaultScene();
// scene.clear();
logJSON({});
var mesh;
xeogl.loadOBJGeometry(scene, objFile, function (geometry) {
var position_indices=xeogl.math.mergeVertices(geometry.positions,geometry.normals,geometry.uv,geometry.indices);
var geom=new xeogl.Geometry(scene,{
id:geometry.id+"_",
meta:geometry.meta,
primitive:geometry.primitive,
positions:position_indices.positions,
normals:position_indices.normals,
uv:position_indices.uv,
colors:geometry.colors,
indices:position_indices.indices,
quantized:true,
combined:true,
edgeThreshold:geometry._edgeThreshold
});
// scene.components["_18_"].destroy();
geometry= geom;
mesh = new xeogl.Mesh({
geometry:geom
});
scene.on("tick", function () {
stats = xeogl.stats;
logJSON(stats);
});
});
new xeogl.CameraControl();
}
function onModelChange(elem) {
let objURL = URL.createObjectURL(elem.files[0]);
loadObj(objURL);
}
Expected behavior
It should display updated values after removing the duplicate vertices(using MergeVertices API) but instead of reducing the values of parameters, xeogl.stats produces higher values(normals before were 200, after merge vertices API call xeogl.stats shows 65.333 ,which is wrong).
Desktop (please complete the following information):
Browser : chrome, Firefox
The text was updated successfully, but these errors were encountered:
I am trying to optimize my OBJ model using MergeVertices API. while checking for the parameters(modified indices, positions, uvs, normals) using xeogl.stats, It does update the stats, but wrongly, or abruptly(example : normals =65.3333).
Please see the code below.
function loadObj(objFile) {
var scene = xeogl.getDefaultScene();
// scene.clear();
logJSON({});
}
function onModelChange(elem) {
let objURL = URL.createObjectURL(elem.files[0]);
loadObj(objURL);
}
function logJSON(json) {
// json.client.browser = json.client.browser.substring(0, 10) + "...";
document.getElementById("logs").innerHTML = JSON.stringify(json, null, 4);
}
Expected behavior
It should display updated values after removing the duplicate vertices(using MergeVertices API) but instead of reducing the values of parameters, xeogl.stats produces higher values(normals before were 200, after merge vertices API call xeogl.stats shows 65.333 ,which is wrong).
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: