r/howdidtheycodeit • u/AgentCooderX • Jul 03 '21
How did they code the camera view for Plastiek comics (Protanopia)
link here:https://www.patreon.com/plastiek
one of their popular game is Protanopia
(iOS)https://apps.apple.com/us/app/protanopia/id1289546434
youtube here:https://www.youtube.com/watch?v=afr27sHwDGU
The camera seems static on some object and doing "parallax" at the background, sometimes i think the camera fixed on one object and when the device is rotated, it rotates around the object keeping the object at the center.Maybe just like how facebook 3D is doing it.
Perhaps i think my question is, how do the camera rotation done on this?
Any ideas?
3
u/airportakal Jul 03 '21
I'm not sure if it's exactly the same, but I coded something similar once in a 2D Godot game, but based on mouse movement rather than gyro movement.
It's simple multi layer parallax. Every layer moves a bit based on input, but each layer has factor determining how much they move. Layers closer to the front move less than layer to the back. The movement factor directly translates to the (apparent) distances from the camera.
You also need to determine a center point, which will be the part moving least / not at all.
It's a very effective faux-3D effect, especially when combined with gyro or eye tracking.
5
u/Tili_us Jul 03 '21
I would attempt this by using the Accelerometer and the Gyroscope as some sort of input to drive the camera offset angles(pitch and yaw) for each panel (within a safe limits).
3
u/FourHeffersAlone Jul 04 '21
Looking at the video, this isn't purely a parallax 2D effect. There's a 3D scene with some geometry that's textured to fit the art style. At least for some of these panels, for example you can see the perspective change on the boat pilots steering wheel. My guess is they do a base parallaxing for most things and there are a few scenes with geometry that they create.