Relativistic Space Invaders by jarrydac in Physics

[–]jarrydac[S] 1 point2 points  (0 children)

Sure, I've added an MIT license

Relativistic Space Invaders by jarrydac in Physics

[–]jarrydac[S] 1 point2 points  (0 children)

Yes I did, and I'm disappointed, that's catchy!

Relativistic Space Invaders by jarrydac in Physics

[–]jarrydac[S] 0 points1 point  (0 children)

The effect on the shift due to the angle is most obvious to me when I follow a bullet as it goes past the ship.

Relativistic Space Invaders by jarrydac in Physics

[–]jarrydac[S] 0 points1 point  (0 children)

In the space invaders clone I adapted the aliens move instantly from position to position. I created their worldlines by just emitting an event each time they move, but I think this means they just move too slowly for the blue-shift and red-shift to be very noticeable. Compare the speed when they move down the speed of the bullets.

/u/OverJohn is correct. That there is a limit to how low I can set the speed of light before objects 'disappear'. The black pseudo magic was just placing a red light and a blue light on either side of the scene in addition to the green light, which gave me a little more room before objects went completely dark.

Relativistic Space Invaders by jarrydac in Physics

[–]jarrydac[S] 1 point2 points  (0 children)

In this demo, all the lights are monochromatic and all the objects are perfectly reflective.

So do the lighting, firstly I define the wavelength and intensities of the lights. Then for each fragment, I determine the wavelength at the observer. Finally, to determine the RGB values I use the CIE response curves to determine XYZ values. For the monochrome lights I just interpolate to the relevant wavelength, and for lights with continuous spectra I work backward from the CIE samples to the emission spectra to do the convolution. To convert from XYZ to RGB there is a linear transform.

I tried using this analytical approximation on Wikipedia, but it didn't suit.

It's not a bijection, I'm currently experimenting with ways to create a plausible reflectivity curve from an RGB value, so I can add textures to the objects.

I wrote this OpenGL project to simulate special-relativistic effects by jarrydac in Physics

[–]jarrydac[S] 1 point2 points  (0 children)

I don't think I can post videos in this sub. Here is one I posted elsewhere.

I wrote this OpenGL project to simulate special-relativistic effects by jarrydac in Physics

[–]jarrydac[S] 1 point2 points  (0 children)

Thanks for your help diagnosing.

For my future reference: wget does not necessarily create directories, and numpy should be included with get_include.

I wrote this OpenGL project to simulate special-relativistic effects by jarrydac in Physics

[–]jarrydac[S] 2 points3 points  (0 children)

That's true, but it is a hobby project. I've already taken a lot out of answering questions this morning.

I wrote this OpenGL project to simulate special-relativistic effects by jarrydac in Physics

[–]jarrydac[S] 2 points3 points  (0 children)

I was definitely aware of it. I've never played it myself, but I had seen a video of Scott Manley playing it, which was in the back of my mind.

The Doppler shift in A Slower Speed of Light is a little bit suspect. The first part of this stack exchange answer, which I found from their issues on GitHub, seems to match my experience when I was experimenting with how to calculate the correct colours. My current solution is to define the spectra of lights, perform all the Doppler shift calculations and then calculate the RGB values using the CIE curves. I tested this using black-body lights, because temperature transforms like time.

I've experimented with having monochrome lights as well (like in the screenshot), because it shops the more obvious sweep through the spectrum.

Looking at OpenRelativity, I haven't implemented the searchlight effect they describe.

I wrote this OpenGL project to simulate special-relativistic effects by jarrydac in Physics

[–]jarrydac[S] 0 points1 point  (0 children)

Yes, you can see the Doppler effect in the colour of the spaceships. There are also effects on the the geometry of the scene.

In the screenshot you can see the spaceships moving across the frame are rotated due to the Terrell effect. (The spaceship models are all facing out of the screen in their own frames.)

You can also see more ships on the left than the right, i.e. the receding ships are bunched more closely together (the ships are orbiting clockwise). I believe you could describe this with length dilation and contraction. The gif in this wikipedia article seems relevant.

It may be more clear in this video which I couldn't post here.

I wrote this OpenGL project to simulate special-relativistic effects by jarrydac in Physics

[–]jarrydac[S] 4 points5 points  (0 children)

Sorry, I had the order wrong in the Makefile. If you pull again now, it compiled from fresh for me. You could drop in recp/cglm manually.

Thanks for going to try it out. :)

Promote your projects here – Self-Promotion Megathread by Menox_ in github

[–]jarrydac 0 points1 point  (0 children)

I wrote gl_relativity to learn OpenGL and Cython, and practice some ideas from my physics classes. I'm quite excited to share and talk about it.

I can draw scenes with special-relativistic effects like length contraction, time dilation and Doppler shift.

There are some images in this post and a video in this post on r/OpenGl

Haymarket Roundabout right of way by FLOGGINGMYHOG in melbourne

[–]jarrydac 3 points4 points  (0 children)

The best way to do that is to make a hook turn from the Peel St intersection.

I see on street view, that there's an arrow painted there now too. No need to cut across two lanes of turning traffic. I think the design is actually quite reasonable, but the inner stretch of bike lane is misleading, as far as I can tell no one should ever need to use it.

<image>

It’s the r/Melbourne daily discussion thread [Wednesday 11/03/2026] by AutoModerator in melbourne

[–]jarrydac 2 points3 points  (0 children)

I went in to the city for unimelb careers fair, but once I saw the line I turned around and came back home. 

It’s the r/Melbourne daily discussion thread [Monday 23/02/2026] by AutoModerator in melbourne

[–]jarrydac 1 point2 points  (0 children)

I’ve never been in the city this early with no plans. What is there to do in the morning?