• <tfoot id='8ssCh'></tfoot>

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

        <legend id='8ssCh'><style id='8ssCh'><dir id='8ssCh'><q id='8ssCh'></q></dir></style></legend>

        <small id='8ssCh'></small><noframes id='8ssCh'>

        用 Three.js 画一个圆(没有阴影)

        时间:2023-09-08

            <bdo id='mWOhB'></bdo><ul id='mWOhB'></ul>

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

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

                    <tbody id='mWOhB'></tbody>
                1. 本文介绍了用 Three.js 画一个圆(没有阴影)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试绘制一个与 this 网站上的轨道图案非常相似的圆圈.我想使用 Three.js 而不是纯 WebGL.

                  I am trying to draw a circle very similar to the orbital patterns on this website. I would like to use Three.js instead of pure WebGL.

                  推荐答案

                  Three.js r50 添加了CircleGeometry.在 WebGL 几何示例中可以看到它(尽管有一张脸).

                  Three.js r50 added CircleGeometry. It can be seen (albeit with a face) in the WebGL Geometries example.

                  几何中的第一个顶点创建在圆的中心(在 r84 中,请参阅 CircleGeometry.js 第 71 行,在 r65 中,请参阅 CircleGeometry.js 第 18 行),如果你想要完整的吃豆人"或无信息的饼图"外观,这很不错.哦,如果您要使用除 LineBasicMaterial/LineDashedMaterial 之外的任何材料,这似乎是必要的.

                  The first vertex in the geometry is created at the center of the circle (in r84, see CircleGeometry.js line 71, in r65, see CircleGeometry.js line 18), which is nifty if you are going for that "full Pac-Man" or "uninformative pie chart" look. Oh, and it appears to be necessary if you are going to use any material aside from LineBasicMaterial / LineDashedMaterial.

                  我已验证以下代码在 r60 和r65:

                  I've verified that the following code works in both r60 & r65:

                  var radius   = 100,
                      segments = 64,
                      material = new THREE.LineBasicMaterial( { color: 0x0000ff } ),
                      geometry = new THREE.CircleGeometry( radius, segments );
                  
                  // Remove center vertex
                  geometry.vertices.shift();
                  
                  // Non closed circle with one open segment:
                  scene.add( new THREE.Line( geometry, material ) );
                  
                  // To get a closed circle use LineLoop instead (see also @jackrugile his comment):
                  scene.add( new THREE.LineLoop( geometry, material ) );
                  

                  PS:文档"现在包含一个不错的 CircleGeometry 交互式示例:https://threejs.org/docs/#api/geometries/CircleGeometry

                  PS: The "docs" now include a nice CircleGeometry interactive example: https://threejs.org/docs/#api/geometries/CircleGeometry

                  这篇关于用 Three.js 画一个圆(没有阴影)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 JavaScript 中查找多边形的中心点 下一篇:如何用 CSS 绘制一个不完整的圆圈以及如何在其中

                  相关文章

                  最新文章

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

                    <legend id='yd4Rt'><style id='yd4Rt'><dir id='yd4Rt'><q id='yd4Rt'></q></dir></style></legend>

                        <bdo id='yd4Rt'></bdo><ul id='yd4Rt'></ul>
                    1. <small id='yd4Rt'></small><noframes id='yd4Rt'>