Maths for Movement!

part of 3d tech for the web course

Aims and Objectives

movement

sums and movement

simulation

youtube

Position

    this.mesh.position.set(20, -50, 30);
  
    this.mesh.position.x = 20;
    this.mesh.position.y = -50;
    this.mesh.position.z = 30;
  

Movement

    fall_speed = -1;
  
    this.mesh.position.y = this.mesh.position.y - fall_speeed;
  

Movement in 3D

    var movement = new THREE.Vector3();
  
    movement.x = 1;
    movement.y = 0;
    movement.z = 1;
  
    this.mesh.position = this.mesh.position. + movement;
  

Acceleration

    fall_speed = 0;
    gravity_acc = -0.04;
  
    fall_speed = fall_speed + gravity_acc;
    this.mesh.position.y = this.mesh.position.y - fall_speeed;
  

Acceleration in 3D

    var movement = new THREE.Vector3(0, 0, 0);
    var acceleration = new THREE.Vector3(0.05, 0, 0.05);
  
    movement = movement + acceleration;
  
    this.mesh.position = this.mesh.position. + movement;
  
http://www.larsberg.net/

Thanks