You are browsing as a guest. Sign up (or log in) to start making projects!

Physics Simulation

  • 2 Devlogs
  • 3 Total hours

A physics simulation experiment, written in Go

Open comments for this post

2h 12m 59s logged

I’ve been working on my physics simulation and I had to convert between two coordinate systems (world space and screen space). My brain really struggled with this one for some reason.


After spending some time trying to work it out in code I gave up and had to create a drawing in Freeform and literally draw out and rescale the vectors, moving them to where they needed to be.
So that’s what this screenshot is! I’ll explain what everything means.
Basically, everything in my engine is a 2D vector. I have a point in world space (represented as a vector of course) and need to convert it to screen space, but they have different origins (center vs top left). The idea is to display it as if it was world space but on the screen. The arrows are me physically placing, moving, and scaling the vectors to find the pattern that converts them.


Anyways, that was hard haha. It broke my brain

0
0
2
Open comments for this post

1h 8m 34s logged

Starting to make a Physics Simulation, written in Go.

I just finished setting up the project to use “ebiten,” a UI library for Go. Additionally, I created a type Vector2D struct with an X and Y as well as Add, Subtract, Scale, Dot, and Rotate methods.

Unfortunately, I don’t have any interesting images to put here, so here’s a screenshot of the vector code :)

0
0
4

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…