we could manipulate a mesh into behaving like a jelly. If we set those points at the vertices of a mesh, and make connections between each vertex pair. The basic concept of all dynamic and jelly-like bodies is to use springs: connection between points that makes them remain their original distance. Repository: Softbody - contains class of an single SoftVertex and Softbody that handles all SoftVertices making mesh fit with them. Also for optimization: this could be a good thing to use compute shaders as a lot of simple tasks can be done in parallel. This works pretty well with static object that can be touched and their shape doesn't change much. Touching a balloon makes a small hole and expands whole object in all directions as we reduced volume of an space inside the balloon.Īlso, we should reduce velocity of each point each frame, and try to settle the points back onto their original positions. Modifying base vertex that is just float x, y, z with velocity, initial position and current deformation position, can give an interesting results.Īdding some pressure/input, modifies all vertices by giving them some velocity based on distance from the "touch point". There are so many things you can do with vertices, triangles and meshes, but those basics and this idea of changing mesh is crucial in implementing a some sort of Jelly-like object. MonoBehaviour Unity) we should also update our current mesh with: mesh.vertices = waveVertices Each point on the grid can be updated each frame with a function: y = sin(x + Time.time) in a shader or in some code. Create triangles, so each square of an grid consists of two triangles.ģ. Create a water surface as a point grid.Ģ. Mesh, that changes it's shape over time, should update it's vertices each frame, so the rendered object fits our data.ġ. Generating your own mesh isn't a hard task: just give it some points, tell which points generate triangle and voilà. In the simplest form, mesh consists of vertices (points in a space) and triangles (defined by those points). Basics of MeshesĮach mesh has a lot of data in it. However, this README has an information on how to make it regardless of engine, language you want to use. Unity, the most popular game engine in the world right now, should provide us with good basis on how to render and handle our Softbodies. Their responsiveness to our input and strange force that causes them to remain overall shape generates a weird fun that cannot be described in words. Those objects are always a nice addition to a interactive world. This is an exploration of an idea of making dynamic, jelly-like meshes. Softbodies, jiggly items and other slimy stuff in Unity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |