• <bdo id='kZQCn'></bdo><ul id='kZQCn'></ul>
  1. <legend id='kZQCn'><style id='kZQCn'><dir id='kZQCn'><q id='kZQCn'></q></dir></style></legend><tfoot id='kZQCn'></tfoot>

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

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

      将 WebGL 非连续行渲染为单个对象

      Render WebGL non-contiguous lines as a single object(将 WebGL 非连续行渲染为单个对象)

        <tfoot id='metyE'></tfoot>
          <tbody id='metyE'></tbody>

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

              1. 本文介绍了将 WebGL 非连续行渲染为单个对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有多个要渲染的 WebGL 行,它们都具有相同的渲染样式.因此,为了提高性能,我想在一次绘制调用中将它们全部渲染为一个对象.

                但问题是这些线路并非都相互连接.

                在此处查看示例:.

                three.js r.58

                附:three.js 包括 requestAnimationFrame() 垫片.您不需要自己包含它.

                I have multiple WebGL lines to render, and they all have the same rendering style. So for performance, I want to render them all as a single object, in a single draw call.

                But the problem is that the lines don't all connect to each other.

                See example here: http://jsfiddle.net/b6jgS/6/

                As you can see the rings connect, but I don't want them to. Yet I still want to draw them in a single draw call.

                The relevant code is this, which simply generates some geometry for some rings:

                # Pardon the coffeescript!
                ringsGeom =  new THREE.Geometry()
                for u in [-2..2]
                  for v in [0..100]
                    ringsGeom.vertices.push new THREE.Vector3(
                      Math.sin(v/100 * 2 * Math.PI)
                      Math.cos(v/100 * 2 * Math.PI)
                      u
                    )
                
                
                rings = new THREE.Line(
                  ringsGeom
                  new THREE.LineBasicMaterial(
                    color: 0xffff00
                    linewidth: 1
                  )
                )
                scene.add rings
                

                How do I have a single object draw multiple discreet disconnected lines?

                解决方案

                You construct your geometry as an array of pairs of points representing individual line segments, and then create your line like so:

                var line = new THREE.Line( geometry, material, THREE.LinePieces );
                

                For an example, see GridHelper.js.

                three.js r.58

                P.S. three.js includes the requestAnimationFrame() shim. You do not need to include it yourself.

                这篇关于将 WebGL 非连续行渲染为单个对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)
                CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                Ordinals in words javascript(javascript中的序数)
                getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                <legend id='0UfcU'><style id='0UfcU'><dir id='0UfcU'><q id='0UfcU'></q></dir></style></legend>

                <small id='0UfcU'></small><noframes id='0UfcU'>

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

                        <tbody id='0UfcU'></tbody>

                        1. <tfoot id='0UfcU'></tfoot>