Ball rotation game. p5.js rotation and 3d experiments. Play game here.
Ball Rotation
Reference:
Introduction
Mobile game, ball on surface. Ball defined as sphrere, texture by V.
Move object:
- rotationX
- pRotationX
- 2D rotation experiments available here.
Setup
Create repo (github). Preferences already correct, gh-pages created as default. Create readme and .gitignore (java).
git clone https://github.com/talonendm/ballrotation.git
Geolocation
- p5 experiments maps
- A double representing the velocity of the device in meters per second.
- geodistance p5 - calcgeodistance. Online calculation - www.movable-type.co.uk.
navigator.geolocation.getCurrentPosition(
function(position) {
text("speed: " + position.coords.speed, 5, 10);
text("heading: " + round(position.coords.heading), 5, 40); // heading in degrees
},
// Optional error callback
function(error){
/*
Error object
error = {
code - Error code representing the type of error
1 - PERMISSION_DENIED
2 - POSITION_UNAVAILABLE
3 - TIMEOUT
message - Details about the error in human-readable format.
}
// auto indect in vscode: shift-alt-f
*/
}
);