Java Code Examples for processing.core.PMatrix3D#rotateY()

The following examples show how to use processing.core.PMatrix3D#rotateY() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Skylight_BulletPhysics_Breakable.java    From PixelFlow with MIT License 5 votes vote down vote up
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);
}
 
Example 2
Source File: Skylight_BulletPhysics_Breakable.java    From PixelFlow with MIT License 5 votes vote down vote up
public void scene4(){
  reset();
  
  float mass_mult = 0.33f;
  Vector3f window1_dim = new Vector3f(300, 500, 6);
  Vector3f window2_dim = new Vector3f(400, 300, 6);
  Vector3f window3_dim = new Vector3f(500, 200, 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.rotateY(90 * toRadians);
  win1_mat.translate(-(20 + window1_dim.x*0.5f + window1_dim.z), 0, 0);
  window1.initBody(window1_dim, win1_mat, window1_rgb, mass_mult);
  createFitting(win1_mat, window1_dim);
  
  PMatrix3D win2_mat = new PMatrix3D();
  win2_mat.rotateY(90 * toRadians);
  win2_mat.translate(-(20 + window2_dim.x*0.5f + window2_dim.z), 0, 150);
  window2.initBody(window2_dim, win2_mat, window2_rgb, mass_mult);
  createFitting(win2_mat, window2_dim, true);
  
  
  PMatrix3D win3_mat = new PMatrix3D();
  win3_mat.rotateY(90 * toRadians);
  win3_mat.translate(-(20 + window3_dim.x*0.5f + window3_dim.z), 0, -150);
  window3.initBody(window3_dim, win3_mat, window3_rgb, mass_mult);
  createFitting(win3_mat, window3_dim, true);
}
 
Example 3
Source File: Skylight_BulletPhysics_Breakable_VideoExport.java    From PixelFlow with MIT License 5 votes vote down vote up
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);
}
 
Example 4
Source File: Skylight_BulletPhysics_Breakable_VideoExport.java    From PixelFlow with MIT License 5 votes vote down vote up
public void scene4(){
  reset();
  
  float mass_mult = 0.33f;
  Vector3f window1_dim = new Vector3f(300, 500, 6);
  Vector3f window2_dim = new Vector3f(400, 300, 6);
  Vector3f window3_dim = new Vector3f(500, 200, 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.rotateY(90 * toRadians);
  win1_mat.translate(-(20 + window1_dim.x*0.5f + window1_dim.z), 0, 0);
  window1.initBody(window1_dim, win1_mat, window1_rgb, mass_mult);
  createFitting(win1_mat, window1_dim);
  
  PMatrix3D win2_mat = new PMatrix3D();
  win2_mat.rotateY(90 * toRadians);
  win2_mat.translate(-(20 + window2_dim.x*0.5f + window2_dim.z), 0, 150);
  window2.initBody(window2_dim, win2_mat, window2_rgb, mass_mult);
  createFitting(win2_mat, window2_dim, true);
  
  
  PMatrix3D win3_mat = new PMatrix3D();
  win3_mat.rotateY(90 * toRadians);
  win3_mat.translate(-(20 + window3_dim.x*0.5f + window3_dim.z), 0, -150);
  window3.initBody(window3_dim, win3_mat, window3_rgb, mass_mult);
  createFitting(win3_mat, window3_dim, true);
}
 
Example 5
Source File: RSTTransform.java    From PapARt with GNU Lesser General Public License v3.0 5 votes vote down vote up
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);
}
 
Example 6
Source File: _prmatrotatey.java    From mesh with MIT License 5 votes vote down vote up
public static Object invoke(final Object arg0, final double angle)
{
    final PMatrix3D mat = (PMatrix3D)arg0;

    mat.rotateY((float)angle);

    return mat;
}