Hi all, I’m new in playcanvas I’m having some problems.
I’m using harware instancing similar to this example:
https://playcanvas.github.io/#/graphics/hardware-instancing
But instead of using a random postion for each object, like in the example, I am using the position of each vertex of a model, i.e. on each vertex of the model there is an intance.
I get the position of each vertex by iterating, similar to this:
let iterator = new pc.VertexIterator(buffer);
for(let i = 0; i < buffer.getNumVertices(); i++) {
let posSem = iterator.element[pc.SEMANTIC_POSITION];
let posX = posSem.array[posSem.index];
let posY = posSem.array[posSem.index + 1];
let posZ = posSem.array[posSem.index + 2];
pos.set(posX,posY,posZ);
The problem is when I rotate the figure with the vertexs, for example over y axis, the position of each vertex I get are without considering the rotation.
There is any way to get the position of each vertex taken into account the rotation?
Thanks in advance.