GLBufferAttribute.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html lang="ar">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body class="rtl">
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. لا يقوم هذا الفئة السمة المخزنة بإنشاء VBO. بدلاً من ذلك، يستخدم
  13. أي VBO يتم تمريره في المُنشئ ويمكن تغييره لاحقًا عبر خاصية
  14. `buffer`.<br /><br />
  15. من الضروري تمرير معلمات إضافية جنبًا إلى جنب مع VBO. هذه هي: GL
  16. context، نوع البيانات GL، عدد المكونات لكل رأس، عدد البايتات لكل
  17. مكون، وعدد الرؤوس.<br /><br />
  18. أكثر حالات الاستخدام شيوعًا لهذه الفئة هي عندما يتداخل نوع من
  19. حسابات GPGPU أو حتى ينتج VBOs المعنية.
  20. </p>
  21. <h2>Examples</h2>
  22. <p>
  23. [example:webgl_buffergeometry_glbufferattribute Points with custom buffers]<br />
  24. </p>
  25. <h2>المنشئ (Constructor)</h2>
  26. <h3>[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count], [param:Boolean normalized] )</h3>
  27. <p>
  28. `buffer` — يجب أن يكون
  29. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer].
  30. <br />
  31. `type` — واحد من
  32. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types أنواع بيانات WebGL].
  33. <br />
  34. `itemSize` — عدد قيم المصفوفة التي يجب ربطها برأس معين. على سبيل
  35. المثال، إذا كانت هذه السمة تخزن متجهًا ثلاثي الأبعاد (مثل الموضع،
  36. الطبيعي، أو اللون)، فيجب أن يكون itemSize هو 3.
  37. <br />
  38. `elementSize` — 1، 2 أو 4. الحجم المقابل (بالبايت) للمعلمة "type"
  39. المعطاة.
  40. </p>
  41. <ul>
  42. <li>gl.FLOAT: 4</li>
  43. <li>gl.UNSIGNED_SHORT: 2</li>
  44. <li>gl.SHORT: 2</li>
  45. <li>gl.UNSIGNED_INT: 4</li>
  46. <li>gl.INT: 4</li>
  47. <li>gl.BYTE: 1</li>
  48. <li>gl.UNSIGNED_BYTE: 1</li>
  49. </ul>
  50. <p>`count` — عدد الرؤوس المتوقع في VBO.</p>
  51. <p>
  52. `normalized` — (optional) Applies to integer data only.
  53. Indicates how the underlying data in the buffer maps to the values in the
  54. GLSL code. For instance, if [page:WebGLBuffer buffer] contains data of
  55. `gl.UNSIGNED_SHORT`, and [page:Boolean normalized] is true, the values `0 -
  56. +65535` in the buffer data will be mapped to 0.0f - +1.0f in the GLSL
  57. attribute. A `gl.SHORT` (signed) would map from -32768 - +32767 to -1.0f
  58. - +1.0f. If [page:Boolean normalized] is false, the values will be
  59. converted to floats unmodified, i.e. 32767 becomes 32767.0f.
  60. </p>
  61. <h2>الخصائص (Properties)</h2>
  62. <h3>[property:WebGLBuffer buffer]</h3>
  63. <p>
  64. نسخة
  65. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLBuffer WebGLBuffer] الحالية.
  66. </p>
  67. <h3>[property:Integer count]</h3>
  68. <p>عدد الرؤوس المتوقع في VBO.</p>
  69. <h3>[property:Integer elementSize]</h3>
  70. <p>
  71. يخزن الحجم المقابل بالبايت لقيمة خاصية `type` الحالية.
  72. </p>
  73. <p>انظر أعلاه (المُنشئ) لقائمة بأحجام الأنواع المعروفة.</p>
  74. <h3>[property:Boolean isGLBufferAttribute]</h3>
  75. <p>للقراءة فقط. دائمًا `true`.</p>
  76. <h3>[property:Integer itemSize]</h3>
  77. <p>كم عدد القيم التي تشكل كل عنصر (رأس).</p>
  78. <h3>[property:String name]</h3>
  79. <p>
  80. اسم اختياري لهذه الحالة من السمة. الافتراضي هو سلسلة فارغة.
  81. </p>
  82. <h3>[property:Boolean needsUpdate]</h3>
  83. <p>
  84. الافتراضي هو `false`. تعيين هذا إلى true يزاد
  85. [page:GLBufferAttribute.version version].
  86. </p>
  87. <h3>[property:Boolean normalized]</h3>
  88. <p>
  89. Indicates how the underlying data in the buffer maps to the values in the
  90. GLSL shader code. See the constructor above for details.
  91. </p>
  92. <h3>[property:GLenum type]</h3>
  93. <p>
  94. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants#Data_types نوع بيانات WebGL] يصف محتوى VBO الأساسي.
  95. </p>
  96. <p>
  97. قم بتعيين هذه الخاصية معًا مع `elementSize`. الطريقة المستحسنة هي
  98. باستخدام طريقة `setType`.
  99. </p>
  100. <h3>[property:Integer version]</h3>
  101. <p>
  102. رقم إصدار، يزاد كل مرة يتم فيها تعيين خاصية needsUpdate على true.
  103. </p>
  104. <h2>الوظائف (Methods)</h2>
  105. <h3>[method:this setBuffer]( buffer )</h3>
  106. <p>تضبط خاصية `buffer`.</p>
  107. <h3>[method:this setType]( type, elementSize )</h3>
  108. <p>تضبط كلاً من خصائص `type` و `elementSize`.</p>
  109. <h3>[method:this setItemSize]( itemSize )</h3>
  110. <p>تضبط خاصية `itemSize`.</p>
  111. <h3>[method:this setCount]( count )</h3>
  112. <p>تضبط خاصية `count`.</p>
  113. <h2>المصدر (Source)</h2>
  114. <p>
  115. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  116. </p>
  117. </body>
  118. </html>
粤ICP备19079148号