cckolon / torpedo-evasion

0 stars 0 forks source link

submarine mathematics to sail ship enjine. #1

Closed RimeOCRLIB closed 1 year ago

RimeOCRLIB commented 1 year ago

Good day.

First of all thank you from my heart for your generous open source contribution to all marine community. At present we are working on sail ship movement project. https://github.com/vlytsus/unity-3d-boat/issues/1 May I ask you give us permission to use your rudder and hull inertia code for sail ship?

With best regards Alexander

cckolon commented 1 year ago

Go ahead!

On Sun, Jul 30, 2023, 03:45 Alexander Stroganov @.***> wrote:

Good day.

First of all thank you from my heart for your generous open source contribution to all marine community. At present we are working on sail ship movement project. vlytsus/unity-3d-boat#1 https://github.com/vlytsus/unity-3d-boat/issues/1 May I ask you give us permission to use your rudder and hull inertia code for sail ship?

With best regards Alexander

— Reply to this email directly, view it on GitHub https://github.com/cckolon/torpedo-evasion/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUA2AJTF4U7MJWSVA4VNHHLXSY3LDANCNFSM6AAAAAA25DPOOU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cckolon commented 1 year ago

Wow, that looks like a great resource. Your project looks very cool too!

Feel free to use as much of my code as you want. It is a little hacky, but there is some good stuff there as well.

Carl

On Sun, Jul 30, 2023 at 11:23 AM Alexander Stroganov < @.***> wrote:

Great. Thank you for reply. Unity 2022 have nice scriptable water with underwater view

@.***/manual/WaterSystem-scripting.html

It provide z-axis data for ship buoyancy.

— Reply to this email directly, view it on GitHub https://github.com/cckolon/torpedo-evasion/issues/1#issuecomment-1657236080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUA2AJRDXXIRMFO2AR5POFDXS2RBHANCNFSM6AAAAAA25DPOOU . You are receiving this because you commented.Message ID: @.***>

RimeOCRLIB commented 1 year ago

Thank you a lot for Open Source cooperation spirit.

For now need to choose water rendering approach which support floating. Modern approach it is to use shader displacement map as Z axis coordinate for float script. It is not friendly for mobile devices and need a lot of heat on PC. Crest package not work with OpenGL and WebGL at all. This one is old but really fast and good for floating ships and waves. For nice view we may add modern water shader to it. For sad this code use sin(x) waves only. For distance to water surface it is use the same wave function which generate waves for mesh. For buoyancy calculation it is use normals to every triangle of underwater hull mesh. From point of view of ship load and ballast it is not correct approach. https://github.com/Habrador/Unity-Boat-physics-Tutorial/blob/master/README.md

This code use functions for generate waves in mesh ocean. Buoyancy calculates as distance between face of water mesh and every n-point of floating object volume (vortex in code).
This approach is realistic, give us opportunity to use different waves functions and shaders and relatively easy to code. It is also CPU-friendly. Vortex points fill all ship hull and we may use addition function of ship load and ballast to calculate really physical accurate buoyancy. https://github.com/dbrizov/NaughtyWaterBuoyancy/blob/master/Assets/NaughtyWaterBuoyancy/Scripts/Core/FloatingObject.cs#L125

For now submarine in code have only underwater buoyancy. Will be nice have realistic surface submerging and mooring.

As direction of development we have in mind ship yard with docking and different ships missions. Good mooring example it is https://www.youtube.com/watch?v=P9ljpf54LAk This project implemetn really good ship inertia physics.

Also. Your work about swarms have civilian application. In short swarm approach may solve traveling salesman problem more fast and accurate then traditional convolution network. Traveling salesman problem have a lot of application in AI. This is example how biological swarm solve labirint. https://www.youtube.com/watch?v=7YWbY7kWesI

RimeOCRLIB commented 1 year ago

We may use this water with simple buoyancy calcolation Image1

or more simple water with accurate physical buoyancy. Image2

May be we will use this water for now. It have accurate physics, scriptable waves and refraction. Image_water

For now this shaders not mobile-friendly and need CPU power. As solution we may try use different mesh resolution and shaders on distance.