I am making the application in that I am making a 360 image and I want to add an object or cross myself in front of the ie camera (billboard concept).
So, I'm tired of things from, but I did not understand how to do this below, this is my code that I am trying to do.
Vector3 position;
float[] newPosition4 = new float[4];
position = obj.getPosition();
float[] posVec4 = {0, 0, -8, 0.0f};
float[] HeadViewMatrix_inv = new float[16];
Matrix4 HeadViewMatrix4 = new Matrix4();
HeadViewMatrix4.setAll(getCurrentCamera().getViewMatrix());
HeadViewMatrix4 = HeadViewMatrix4.inverse();
HeadViewMatrix4.toFloatArray(HeadViewMatrix_inv);
Matrix.multiplyMV(newPosition4, 0, HeadViewMatrix_inv, 0, posVec4, 0);
obj.setPosition(newPosition4[0], newPosition4[1], newPosition4[2]);
Therefore, anyone can help me with this.
source
share