the primitive objects that i create by geometry data(pos,uv…)is out of shape on iphone,but be normal in other platform;
the Adress: https://trinasolartest_v2.boonray.com/#/?id=290
maincode:
_createGeometry(positions, sts, indices)
{
return new Geometry({
attributes: {
position: new GeometryAttribute({
componentDatatype: ComponentDatatype.DOUBLE,
componentsPerAttribute: 3,
values: positions
}),
st: new GeometryAttribute({
componentDatatype: ComponentDatatype.FLOAT,
componentsPerAttribute: 2,
values: sts
})
},
indices: indices,
primitiveType: PrimitiveType.TRIANGLES,
boundingSphere: BoundingSphere.fromVertices(positions)
});
}
//-------------add group instance(same geometry different modelMatrix ) to a Instance Array;
mat = Matrix4.multiply(this.instances[i].modelMatrix, mat, mat);
let instance = new GeometryInstance({
geometry: cylinder,
modelMatrix: mat
});
cylinderInstances.push(instance);
//------------------------geometryInstances —>to a new primitive
let primitive = new Primitive({
geometryInstances: cylinderInstances,
appearance: app,
asynchronous: false
})
this.viewer.scene.primitives.add(primitive);