本文整理汇总了Java中processing.core.PMatrix3D.rotateX方法的典型用法代码示例。如果您正苦于以下问题:Java PMatrix3D.rotateX方法的具体用法?Java PMatrix3D.rotateX怎么用?Java PMatrix3D.rotateX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.PMatrix3D
的用法示例。
在下文中一共展示了PMatrix3D.rotateX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scene1
import processing.core.PMatrix3D; //导入方法依赖的package包/类
public void scene1(){
reset();
float mass_mult = 0.33f;
Vector3f window1_dim = new Vector3f(600, 300, 6);
Vector3f window2_dim = new Vector3f(400, 500, 6);
Vector3f window3_dim = new Vector3f(300, 600, 6);
float[] window1_rgb = { 96,160,255};
float[] window2_rgb = {255, 96, 32};
float[] window3_rgb = {255,255,255};
BreakableBody window1 = new BreakableBody(this, physics, group_bulletbodies);
BreakableBody window2 = new BreakableBody(this, physics, group_bulletbodies);
BreakableBody window3 = new BreakableBody(this, physics, group_bulletbodies);
PMatrix3D win1_mat = new PMatrix3D();
win1_mat.rotateX(90 * toRadians);
win1_mat.translate(0, 20 + window1_dim.y*0.5f, 0);
win1_mat.rotateY(-10 * toRadians);
window1.initBody(window1_dim, win1_mat, window1_rgb, mass_mult);
createFitting(win1_mat, window1_dim);
PMatrix3D win2_mat = new PMatrix3D();
win2_mat.rotateX(90 * toRadians);
win2_mat.translate(0, 20 + window2_dim.y*0.5f, +150);
window2.initBody(window2_dim, win2_mat, window2_rgb, mass_mult);
createFitting(win2_mat, window2_dim);
PMatrix3D win3_mat = new PMatrix3D();
win3_mat.rotateX(90 * toRadians);
win3_mat.translate(110, 20 + window3_dim.y*0.5f, -150);
win3_mat.rotateY(10 * toRadians);
window3.initBody(window3_dim, win3_mat, window3_rgb, mass_mult);
createFitting(win3_mat, window3_dim);
}
示例2: applyTransformationTo
import processing.core.PMatrix3D; //导入方法依赖的package包/类
public void applyTransformationTo(PMatrix3D matrix) {
matrix.translate(sceneTranslate.x, sceneTranslate.y, sceneTranslate.z);
matrix.rotateX(sceneRotateX);
matrix.rotateY(sceneRotateY);
matrix.rotateZ(sceneRotateZ);
matrix.scale(sceneScale);
}
示例3: scene2
import processing.core.PMatrix3D; //导入方法依赖的package包/类
public void scene2(){
reset();
float mass_mult = 1;
Vector3f window1_dim = new Vector3f(200, 500, 3);
Vector3f window2_dim = new Vector3f(200, 500, 3);
Vector3f window3_dim = new Vector3f(200, 500, 3);
float[] window1_rgb = { 96,160,255};
float[] window2_rgb = {255, 96, 32};
float[] window3_rgb = {255,255,255};
BreakableBody window1 = new BreakableBody(this, physics, group_bulletbodies);
BreakableBody window2 = new BreakableBody(this, physics, group_bulletbodies);
BreakableBody window3 = new BreakableBody(this, physics, group_bulletbodies);
PMatrix3D win1_mat = new PMatrix3D();
win1_mat.rotateX(90 * toRadians);
win1_mat.rotateZ(random(-20,20) * toRadians);
win1_mat.rotateX(random(-10,10) * toRadians);
win1_mat.translate(0, 200 + 20 + window1_dim.y*0.5f, 0);
window1.initBody(window1_dim, win1_mat, window1_rgb, mass_mult);
// createFitting(win1_mat, window1_dim);
PMatrix3D win2_mat = new PMatrix3D();
win2_mat.rotateX(90 * toRadians);
win2_mat.rotateZ(random(-10,10) * toRadians);
win2_mat.rotateX(random(-10,10) * toRadians);
win2_mat.translate(0, 50 + 20 + window2_dim.y*0.5f, +150);
window2.initBody(window2_dim, win2_mat, window2_rgb, mass_mult);
// createFitting(win2_mat, window2_dim);
PMatrix3D win3_mat = new PMatrix3D();
win3_mat.rotateX(90 * toRadians);
win3_mat.rotateZ(random(-10,10) * toRadians);
win3_mat.rotateX(random(-10,10) * toRadians);
win3_mat.translate(0, 100 + 20 + window3_dim.y*0.5f, -150);
window3.initBody(window3_dim, win3_mat, window3_rgb, mass_mult);
// createFitting(win3_mat, window3_dim);
}
示例4: scene3
import processing.core.PMatrix3D; //导入方法依赖的package包/类
public void scene3(){
reset();
float mass_mult = 1;
Vector3f window1_dim = new Vector3f(600, 200, 8);
Vector3f window2_dim = new Vector3f(200, 600, 8);
Vector3f window3_dim = new Vector3f(400, 400, 8);
float[] window1_rgb = { 96,160,255};
float[] window2_rgb = {255, 96, 32};
float[] window3_rgb = {255,255,255};
BreakableBody window1 = new BreakableBody(this, physics, group_bulletbodies);
BreakableBody window2 = new BreakableBody(this, physics, group_bulletbodies);
BreakableBody window3 = new BreakableBody(this, physics, group_bulletbodies);
PMatrix3D win1_mat = new PMatrix3D();
win1_mat.rotateZ(random(-45,45) * toRadians);
// win1_mat.rotateX(random(-5,5) * toRadians);
win1_mat.translate(0, 0, 330);
window1.initBody(window1_dim, win1_mat, window1_rgb, mass_mult);
// createFitting(win1_mat, window1_dim);
PMatrix3D win2_mat = new PMatrix3D();
win2_mat.rotateZ(random(-90,45) * toRadians);
// win2_mat.rotateX(random(-5,5) * toRadians);
win2_mat.translate(0, 0, 460);
window2.initBody(window2_dim, win2_mat, window2_rgb, mass_mult);
// createFitting(win2_mat, window2_dim);
PMatrix3D win3_mat = new PMatrix3D();
win1_mat.rotateZ(random(-45,45) * toRadians);
win3_mat.rotateX(random(-5,5) * toRadians);
win3_mat.translate(0, 0, 200);
window3.initBody(window3_dim, win3_mat, window3_rgb, mass_mult);
createFitting(win3_mat, window3_dim);
// window1.body.setVelocity(new Vector3f(0,0,-100));
// window2.body.setVelocity(new Vector3f(0,0,-100));
}