Giter Site home page Giter Site logo

physics_simulator's Introduction

3-D engine that I made using Javascript, and HTML canvas. Make custom cuboids (a cuboid is a three dimensional rectangle), and make a combination of translational movements and rotational movements.

DOCUMENTATION:

The heart of the application is the transform function.

The transform function takes in 13 arguements.

The first three arguments are the initial position of the physical object (object here is not reffering to the datatype. Think of a physical object like a cube or chair) as x,y,z coordinates in three dimensional space. They're role is more important than that though as they will affect the length of the oribit if a rotational velocity is present.

The fourth arument is the physical object that is about to be displayed. Cuboids can be easily used here as this engine has a cuboid maker function already made. You can make your own custom objects by combining different cuboids in to the desired shape, or you can make your own shape. This argument needs to be an array of arrays of objects whose values are numbers. These numbers are the x,y,z coordinate of the point. The object that as these coordinates is the point. The array that holds these objects is a face. The face here is a two dimensional area. Finally, an array holds these arrays.

The next three arguments are x,y,z rotational velocites. These will be determine the plane that the physical object will travel through. A physical object with an x rotational velocity with no y or z rotational velocities will travel in the y-z plane. A physical object with a y rotational velocity will travel in the x-z plane etc. The higher this number, the faster it will rotate in that direction. A combination of more than one rotational velocity is acceptable.

The next three arguments are the x,y,z coordinates of the point the physical object is rotating about. This in combination with the initial position of the physical object(first three arguments) will determine the length of the orbit.

The next and final three arguments are the x,y,z translational velocities of the physical object. A physical object with an x translational velocity will travel straight in the x-direction, a physical object with a y translational velocity will travel straight in the y direction, etc. The higher this number the faster it will go. A combination of all three is valid.

physics_simulator's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.