• <small id='xi2JT'></small><noframes id='xi2JT'>

      1. <i id='xi2JT'><tr id='xi2JT'><dt id='xi2JT'><q id='xi2JT'><span id='xi2JT'><b id='xi2JT'><form id='xi2JT'><ins id='xi2JT'></ins><ul id='xi2JT'></ul><sub id='xi2JT'></sub></form><legend id='xi2JT'></legend><bdo id='xi2JT'><pre id='xi2JT'><center id='xi2JT'></center></pre></bdo></b><th id='xi2JT'></th></span></q></dt></tr></i><div id='xi2JT'><tfoot id='xi2JT'></tfoot><dl id='xi2JT'><fieldset id='xi2JT'></fieldset></dl></div>

          <bdo id='xi2JT'></bdo><ul id='xi2JT'></ul>
        <legend id='xi2JT'><style id='xi2JT'><dir id='xi2JT'><q id='xi2JT'></q></dir></style></legend>
        <tfoot id='xi2JT'></tfoot>

      2. 制作一个顶点等距的球体

        时间:2023-07-25

            <tbody id='ZWjOC'></tbody>

          <i id='ZWjOC'><tr id='ZWjOC'><dt id='ZWjOC'><q id='ZWjOC'><span id='ZWjOC'><b id='ZWjOC'><form id='ZWjOC'><ins id='ZWjOC'></ins><ul id='ZWjOC'></ul><sub id='ZWjOC'></sub></form><legend id='ZWjOC'></legend><bdo id='ZWjOC'><pre id='ZWjOC'><center id='ZWjOC'></center></pre></bdo></b><th id='ZWjOC'></th></span></q></dt></tr></i><div id='ZWjOC'><tfoot id='ZWjOC'></tfoot><dl id='ZWjOC'><fieldset id='ZWjOC'></fieldset></dl></div>

              • <bdo id='ZWjOC'></bdo><ul id='ZWjOC'></ul>

                <tfoot id='ZWjOC'></tfoot>
                  <legend id='ZWjOC'><style id='ZWjOC'><dir id='ZWjOC'><q id='ZWjOC'></q></dir></style></legend>
                • <small id='ZWjOC'></small><noframes id='ZWjOC'>

                • 本文介绍了制作一个顶点等距的球体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  为了检查碰撞,我正在尝试制作一个球形的光线爆发,但是根据每条光线撞击的内容或位置会发生特定的交互.因此,为什么我使用光线而不是像 OverlapSphere 这样更简单的东西.

                  我正在寻找如何制作球体的原因是因为我可以对光线使用相同的数学运算,让它们到达球体所在位置的顶点.但是我能找到的每一种制作球体的方法都是让线条更靠近两极,这是有道理的,因为它很容易做到.但正如你可以想象的那样,它对我当前的项目没有那么有用.

                  TL;DR:如何制作具有等距顶点的球体?如果它不是完美等距也很好,它只需要非常接近.如果发生这种情况,如果您能提供差异有多大以及在哪里(如果适用),那就太好了.

                  补充说明:我看过

                  要在 Unity 中调出这样的球体,只需执行以下操作:

                  如您所知,您可以立即访问顶点

                  Mesh mesh = GetComponent().mesh;Vector3[] vv = mesh.vertices;int kVerts=vv.Lengthfor (int i=0; i

                  请注意,您可以轻松检查球体的哪个部分";他们通过(例如)检查他们离你的城市"有多远;(或其他)或仅检查(例如)z 值以查看它们位于哪个半球......等等.


                  此外...

                  请注意.关于您想要这样做的总体原因:

                  <块引用>

                  但是会根据每条光线的照射对象或位置发生特定的交互

                  请注意,使用 PhysX 做到这一点再简单不过了.(Unity 中完全内置的游戏物理特性.)事实上,我从来没有在不做特定"事情的情况下看到碰撞.取决于它击中的地方!"

                  例如,您可以通过 http://docs 获取联系人所在的位置.unity3d.com/ScriptReference/RaycastHit-point.html

                  值得注意的是,在休闲编程中写出接近 PhysX 性能的东西是绝对不可想象的.

                  我希望这会让事情变得更容易!

                  I'm trying to make a spherical burst of rays for the purpose of checking collision, but having specific interactions happen based upon what or where each ray hit. Hence why I'm using rays rather then something simpler such as OverlapSphere.

                  The reason I'm looking for how to make a sphere is because I can use the same math for my rays, by having them go to the vertices of where the sphere would be. But every way I can find for making a sphere has the lines get closer the near to the poles, which makes sense, as its pretty easy to do. But as you can imagine, its not that useful for my current project.

                  TL;DR: How do I make a sphere with equidistant vertices? If its not perfectly equidistant its fine, it just needs to pretty close. If this happens, it would be great if you could give how much the difference would be, and where, if applicable.

                  Extra notes: I've looked at this and this, but the math is way over my head, so what I've been looking for might've just been staring me in the face this whole time.

                  解决方案

                  Are you aware that the sphere given to you by Unity is in fact designed

                  with this exact goal in mind?

                  ie, the entire raison d'etre of the sphere built-in to Unity is that the points are fairly smoothly space ...... roughly equidistant, as you phrase it.

                  To bring up such a sphere in Unity, just do this:

                  You can then instantly get access to the verts, as you know

                  Mesh mesh = GetComponent<MeshFilter>().mesh;
                  Vector3[] vv = mesh.vertices;
                  int kVerts=vv.Length
                  for (int i=0; i<kVerts; ++i)
                    Debug.Log ... vv[i] 
                  

                  Note you can easily check "which part of the sphere" they are on by (for example) checking how far they are from your "cities" (or whatever) or just check (for example) the z values to see which hemisphere they are in .. et cetera.


                  Furthermore...

                  Please note. Regarding your overall reason for wanting to do this:

                  but having specific interactions happen based upon what or where each ray hit

                  Note that it could not be easier to do this using PhysX. (The completely built-in game physics in Unity.) Indeed, I have never, ever, looked at a collision without doing something "specific" depending on "where it hit!"

                  You can for example get the point where the contact was with http://docs.unity3d.com/ScriptReference/RaycastHit-point.html

                  It's worth noting it is absolutely inconceivable one could write something approaching the performance of PhysX in casual programming.

                  I hope this makes things easier!

                  这篇关于制作一个顶点等距的球体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <tfoot id='qJ4jT'></tfoot>

                    <small id='qJ4jT'></small><noframes id='qJ4jT'>

                        <tbody id='qJ4jT'></tbody>
                        <bdo id='qJ4jT'></bdo><ul id='qJ4jT'></ul>
                      • <i id='qJ4jT'><tr id='qJ4jT'><dt id='qJ4jT'><q id='qJ4jT'><span id='qJ4jT'><b id='qJ4jT'><form id='qJ4jT'><ins id='qJ4jT'></ins><ul id='qJ4jT'></ul><sub id='qJ4jT'></sub></form><legend id='qJ4jT'></legend><bdo id='qJ4jT'><pre id='qJ4jT'><center id='qJ4jT'></center></pre></bdo></b><th id='qJ4jT'></th></span></q></dt></tr></i><div id='qJ4jT'><tfoot id='qJ4jT'></tfoot><dl id='qJ4jT'><fieldset id='qJ4jT'></fieldset></dl></div>
                      • <legend id='qJ4jT'><style id='qJ4jT'><dir id='qJ4jT'><q id='qJ4jT'></q></dir></style></legend>