tubeshowcase●1,072,387 videos♡ My collection 0
← Learn to Code

Learn to Code12:38

5.3: Box2D Coordinates and Vectors - The Nature of Code

The Coding Train ↗

From the creator

This video covers the Box2D coordinate system and how to use the Vec2 class. Code: https://thecodingtrain.com/tracks/physics-libraries/physics-libraries/box2d/3-coordinate-and-vectors 🎥 Previous: https://youtu.be/e3VSVZn4BHg 🎥 Next: https://youtu.be/lmYLmcFuj2s References: 🔗 Nature of Code: https://natureofcode.com 🔗 Nature of Code Processing Examples: https://github.com/nature-of-code/noc-examples-processing/tree/master/chp05_physicslibraries/box2d/NOC_5_5_MultiShapes 🔗 Box2D: https://box2d.org 🔗 JBox2d: https://github.com/jbox2d/jbox2d Convert location from World to Pixels Vec2 coordWorldToPixels(Vec2 world) Convert location from World to Pixels Vec2 coordWorldToPixels(float worldX, float worldY) Convert location from Pixels to World Vec2 coordPixelsToWorld(Vec2 screen) Convert location from Pixels to World Vec2 coordPixelsToWorld(float pixelX, float pixelY) Scale a dimension (such as height, width, or radius) from Pixels to World float scalarPixelsToWorld(float val) Scale a dimension from World to Pixels float scalarWorldToPixels(float val) Timestamps: 0:00 Hello 0:42 The Coordinate system 4:47 Vec2 class 8:30 Converting from pixel to world coordinates 11:58 Outro Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound 🚂 Website: https://thecodingtrain.com/ 👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide 🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box 💡 GitHub: https://github.com/Codin

Published 2015-08-06 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code