本文整理匯總了Java中com.vuforia.Matrix44F.setData方法的典型用法代碼示例。如果您正苦於以下問題:Java Matrix44F.setData方法的具體用法?Java Matrix44F.setData怎麽用?Java Matrix44F.setData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vuforia.Matrix44F
的用法示例。
在下文中一共展示了Matrix44F.setData方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Matrix44FIdentity
import com.vuforia.Matrix44F; //導入方法依賴的package包/類
public static Matrix44F Matrix44FIdentity()
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 16; i++)
temp[i] = 0.0f;
temp[0] = 1.0f;
temp[5] = 1.0f;
temp[10] = 1.0f;
temp[15] = 1.0f;
r.setData(temp);
return r;
}
示例2: Matrix44FIdentity
import com.vuforia.Matrix44F; //導入方法依賴的package包/類
public static Matrix44F Matrix44FIdentity()
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 16; i++)
temp[i] = 0.0f;
temp[0] = 1.0f;
temp[5] = 1.0f;
temp[10] = 1.0f;
temp[15] = 1.0f;
r.setData(temp);
return r;
}
示例3: Matrix44FTranspose
import com.vuforia.Matrix44F; //導入方法依賴的package包/類
public static Matrix44F Matrix44FTranspose(Matrix44F m)
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
temp[i * 4 + j] = m.getData()[i + 4 * j];
r.setData(temp);
return r;
}
示例4: Matrix44FTranspose
import com.vuforia.Matrix44F; //導入方法依賴的package包/類
public static Matrix44F Matrix44FTranspose(Matrix44F m)
{
Matrix44F r = new Matrix44F();
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
temp[i * 4 + j] = m.getData()[i + 4 * j];
r.setData(temp);
return r;
}
示例5: setProjectionAndCamera
import com.vuforia.Matrix44F; //導入方法依賴的package包/類
private void setProjectionAndCamera(Display contentProvider, TrackableResult[] trackables, float filedOfView) {
ModelInstance model = contentProvider.modelInstance;
if (trackables != null && trackables.length > 0) {
//transform all content
TrackableResult trackable = trackables[0];
Matrix44F modelViewMatrix = Tool.convertPose2GLMatrix(trackable.getPose());
float[] raw = modelViewMatrix.getData();
float[] rotated;
//switch axis and rotate to compensate coordinates change
if (com.vuforia.Renderer.getInstance().getVideoBackgroundConfig().getReflection() == VIDEO_BACKGROUND_REFLECTION.VIDEO_BACKGROUND_REFLECTION_ON) {
// Front camera
rotated = new float[]{
raw[1], raw[0], raw[2], raw[3],
raw[5], raw[4], raw[6], raw[7],
raw[9], raw[8], raw[10], raw[11],
raw[13], raw[12], raw[14], raw[15]
};
} else {
// Back camera
rotated = new float[]{
raw[1], -raw[0], raw[2], raw[3],
raw[5], -raw[4], raw[6], raw[7],
raw[9], -raw[8], raw[10], raw[11],
raw[13], -raw[12], raw[14], raw[15]
};
}
Matrix44F rot = new Matrix44F();
rot.setData(rotated);
Matrix44F inverse = SampleMath.Matrix44FInverse(rot);
Matrix44F transp = SampleMath.Matrix44FTranspose(inverse);
float[] data = transp.getData();
camera.position.set(data[12], data[13], data[14]);
camera.up.set(data[4], data[5], data[6]);
camera.direction.set(data[8], data[9], data[10]);
//update filed of view
camera.fieldOfView = filedOfView;
} else {
camera.position.set(100, 100, 100);
camera.lookAt(1000,1000,1000);
}
model.transform.set(new Matrix4());
//the model is rotated
model.transform.rotate(1.0F, 0.0F, 0.0F, 90.0F);
model.transform.rotate(0.0F, 1.0F, 0.0F, 90.0F);
model.transform.scale(MODEL_SCALE, MODEL_SCALE, MODEL_SCALE);
camera.update();
}