# Welding Physics (MIG, TIG, ARC etc)

Discussion in 'Physics' started by MorGuux, Nov 1, 2018.

1. ### MorGuux

Joined:
Jun 4, 2016
Posts:
2
Hi, I've been interested in the idea of creating a VR construction game. Features I'd like to include would be grinding, cutting, bolting, screwing, welding, drilling etc.

I was thinking about welding. How would it be possible to visually show a weld, in a realistic way. It would need to create a ball of metal with thermal effect, that could build on itself. It sounds like an idea that's far too complicated for a script kiddie like me to even think about

2. ### BoogieD

Joined:
Jun 8, 2016
Posts:
191
If you have a look at these 4WD mud driving type games, you could probably get the desired effect in a similar way.

I suspect they have a mesh with plenty of tris and deform it dynamically.
That would require fairly complex code accessing the Mesh object in Unity to change the vertices for each frame.
The below link will get you started with some functional code.
https://docs.unity3d.com/ScriptReference/Mesh.html
You will need to study what the various arrays are in a mesh. Vertices, triangles and normals.
Then comes the tricky bit in coding the deformation of the mesh to create the look of a dynamic weld leaving ripples behind. Like a small section of ripples in a pond from a rock except the center is moving with the welding rod. I found this formula in the video link below which you will need to understand and modify:
z=(cos( 0.5sqrt(x^2+y^2)-6n)/(0.5(x^2+y^2)+1+2n), n={0...10}
It maybe easier to just replace a small section of the mesh with pre determined vertex data as you move the rod along it.
You have a steep learning curve ahead. Good luck with the project!

Last edited: Nov 2, 2018
3. ### Steel_Arm

Joined:
Apr 9, 2013
Posts:
22
The welding sounds more like a shader thing than physics. Of course the physics is there, although that's more like gameplay code than anything to do with the physics engine.

SparrowsNest likes this.
4. ### MorGuux

Joined:
Jun 4, 2016
Posts:
2
Yeah, I was thinking of a shader, I saw an example on YouTube at one point
which is exactly what I'd need. I need to get to grips with shaders and how they work in order to progress, but it's something I'm interested in doing, as I think VR is perfect for a sim like this.