in my project I have a player walk around a globe. The globe is not just a sphere, it has mountains and valleys, so I need the players z position to change. For this I’m raycasting a single ray from player’s position against a single object (the globe) and I get the point they intersect and change players position accordingly.
Tag: geometry
Pinch/pucker an image in canvas
How can I pinch/pucker some area of an image in canvas? I’ve made a solar system animation some time ago, and I started rewriting it. Now, I want to add gravity effect to masses. To make the effect visible, I turned the background into a grid and I’ll be modifying it. Desired effect is something like this (made in PS)
Find centerpoint of polygon in JavaScript
I have a “place” object from Google Maps which has a set of coordinates that represent a bounding box for a given location, say London. Each set of coordinates has a latitude and longitude. I have written the below code to find the centerpoint, but I am not sure if it does actually produce the centerpoint. What if the polygon