果冻物理学3D

编程入门 行业动态 更新时间:2024-10-24 11:14:47
本文介绍了果冻物理学3D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想问一下果冻物理学( www.youtube/watch? v = I74rJFB_W1k ),在那里我可以找到一些开始制作类似东西的好地方?我想模拟汽车撞车事故,并且想使用这种果冻物理原理,但是我找不到很多关于它们的知识.我不想使用现有的物理引擎,我想写自己的:)

I want to ask about jelly physics ( www.youtube/watch?v=I74rJFB_W1k ), where I can find some good place to start making things like that ? I want to make simulation of cars crash and I want use this jelly physics, but I can't find a lot about them. I don't want use existing physics engine, I want write my own :)

推荐答案

可以使用质量弹簧系统来实现与您所链接的视频中看到的类似的效果.但是,如果改变质量和弹簧的数量,并保持相同的弹簧常数,则结果将大相径庭.简而言之,质量弹簧系统不是连续物质的良好近似.

Something like what you see in the video you linked to could be accomplished with a mass-spring system. However, as you vary the number of masses and springs, keeping your spring constants the same, you will get wildly varying results. In short, mass-spring systems are not good approximations of a continuum of matter.

通常,这类动画是使用有限元素方法(有限元). FEM 确实收敛到一个连续体,这很好.尽管它确实比质量弹簧系统需要更多的专业知识,但它的确还不错.基本思想源自对连续体力学,可以这样写:

Typically, these sorts of animations are created using what is called the Finite Element Method (FEM). The FEM does converge to a continuum, which is nice. And although it does require a bit more know-how than a mass-spring system, it really isn't too bad. The basic idea, derived from the study of continuum mechanics, can be put this way:

  • 将对象的体积分成许多小块(元素),通常为 tetrahedra .让我们将这些元素的整个集合称为网格.您实际上将要制作该网格的两个副本.标记一个为静止"网格,另一个标记为世界"网格.我会告诉你为什么.

  • Break the volume of your object up into many small pieces (elements), usually tetrahedra. Let's call the entire collection of these elements the mesh. You'll actually want to make two copies of this mesh. Label one the "rest" mesh, and the other the "world" mesh. I'll tell you why next.

    对于您的世界网格中的每个四面体,测量其相对于其对应的其余四面体的变形程度.将其变形的量度称为应变".通常,这是通过首先测量所谓的变形梯度(通常表示为 F )来实现的.有几个 好 文件,其中介绍了如何执行此操作.一旦有了 F ,定义应变( e )的一种非常典型的方法是: e = 1/2( F ^ T * F )- I .这被称为格林氏菌株.它是旋转不变的,因此非常方便.

    For each tetrahedron in your world mesh, measure how deformed it is relative to its corresponding rest tetrahedron. The measure of how deformed it is is called "strain". This is typically accomplished by first measuring what is known as the deformation gradient (often denoted F). There are several good papers that describe how to do this. Once you have F, one very typical way to define the strain (e) is: e = 1/2(F^T * F) - I. This is known as Green's strain. It is invariant to rotations, which makes it very convenient.

    使用您要模拟的材料(明胶,橡胶,钢等)的特性,并使用在上述步骤中测量的应变,得出"应力",每个四面体.

    Using the properties of the material you are trying to simulate (gelatin, rubber, steel, etc.), and using the strain you measured in the step above, derive the "stress" of each tetrahdron.

    对于每个四面体,访问每个节点(顶点,角,点(这些都表示相同的东西)),并对三个三角形面的面积加权法向矢量(其余形状)取平均值节点.将四面体的应力乘以该平均向量,并且由于该四面体的应力而在该节点上作用有弹力.当然,每个节点都可能属于多个四面体,因此您需要对这些力进行汇总.

    For each tetrahedron, visit each node (vertex, corner, point (these all mean the same thing)) and average the area-weighted normal vectors (in the rest shape) of the three triangular faces that share that node. Multiply the tetrahedron's stress by that averaged vector, and there's the elastic force acting on that node due to the stress of that tetrahedron. Of course, each node could potentially belong to multiple tetrahedra, so you'll want to be able to sum up these forces.

    集成!有简单的方法可以做到这一点,而有困难的方法.无论哪种方式,您都希望遍历世界网格中的每个节点,并用其质量除以其力来确定其加速度.从这里开始的简单方法是:

    Integrate! There are easy ways to do this, and hard ways. Either way, you'll want to loop over every node in your world mesh and divide its forces by its mass to determine its acceleration. The easy way to proceed from here is to:

    • 将其加速度乘以较小的时间值 dt .这样可以改变速度 dv .
    • 在节点的当前速度上添加 dv 以获得新的总速度.
    • 将该速度乘以 dt 即可得到位置变化 dx .
    • 将 dx 添加到节点的当前位置以获取新位置.
    • Multiply its acceleration by some small time value dt. This gives you a change in velocity, dv.
    • Add dv to the node's current velocity to get a new total velocity.
    • Multiply that velocity by dt to get a change in position, dx.
    • Add dx to the node's current position to get a new position.

    这种方法称为明确进行欧拉集成.您必须使用非常小的 dt 值才能使其正常工作而不会炸裂,但是实现起来如此容易,以至于它可以很好地作为起点.

    This approach is known as explicit forward Euler integration. You will have to use very small values of dt to get it to work without blowing up, but it is so easy to implement that it works well as a starting point.

    根据需要重复执行第2步到第5步.

    Repeat steps 2 through 5 for as long as you want.

    我遗漏了很多细节和花哨的附加功能,但希望您能推断出我遗漏的很多内容. 这是我第一次使用的一些说明的链接时间我做到了.该网页包含一些有用的伪代码以及一些相关材料的链接.

    I've left out a lot of details and fancy extras, but hopefully you can infer a lot of what I've left out. Here is a link to some instructions I used the first time I did this. The webpage contains some useful pseudocode, as well as links to some relevant material.

    sealab.cs.utah.edu/课程/CS6967-F08/Project-2/

    以下链接也非常有用:

    sealab.cs.utah.edu /Courses/CS6967-F08/FE-notes.pdf

    这是一个非常有趣的话题,祝您好运!如果您遇到困难,请给我留言.

    This is a really fun topic, and I wish you the best of luck! If you get stuck, just drop me a comment.

  • 更多推荐

    果冻物理学3D

    本文发布于:2023-06-04 19:08:42,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/503343.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:果冻   物理学

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!