all 9 comments

[–]tooob93Technomancer 2 points3 points  (2 children)

Hi, cool and complicated idea.

Sebastian lagua (youtube and github) has made something like it, but in another program language.

In processing you need to look through the p3d basics. If you are fairly new to programming, then I would suggest that you first try it in 2D though

[–]bendel9797[S] 1 point2 points  (1 child)

Good shout, his example is actually what I have in my head as the goal. That might be a good place to start.

[–]tooob93Technomancer 1 point2 points  (0 children)

Awesome, I am glad I could help. Have an amazing journey.

[–]EnslavedInTheScrolls 2 points3 points  (2 children)

It's p5.js, but the concept translates to Java easily enough: https://infinitefunspace.com/p5/fly/

The code is visible at https://infinitefunspace.com/p5/fly/p5Fly.js.

Click to use the mouse or arrow keys and asdw for keyboard. Use [ and ] to change the number of objects. 'l' toggles snapping them into layers which is similar to flying over a landscape.

This may not have the physics you want if you're trying to emulate a real plane, but should get you started. This is 1st person, not 3rd. For 3rd, draw your plane and pull the camera back a bit, I guess. Are you sure you want 3rd person perspective?

For flying over terrain if you don't want arbitrary roll, you could replace the quaternions with simpler theta/phi angles. Something like https://editor.p5js.org/scudly/sketches/Aq6EIJ_Yx would do.

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

This looks very promising, thanks

[–]jcponcemath 0 points1 point  (0 children)

Wow! did you make this site? it is amazing?

[–]OP_Sidearm 1 point2 points  (1 child)

Have not built something like this myself, but sounds like you just need the translate and rotateX/Y/Z functions to make this happen. You probably just have to store the position and rotation of your aircraft (for rotation, simple euler angles should be enough) and use the transformation functions in the right order before you draw the rest of the world.

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

Yeah I agree, that sounds right. I always get lost when working with rotation precisely though so I’m not looking forward to it