Class BuilderPart

Manage parts or sections to be built into a model, must have at least one part

Constructors

Properties

_boundingBox: number[]
_customArrayData: undefined | Arrays
_triCount: number = 0
extraAttributes?: extraAttributes

This is an extremely advanced feature, and allows you to add custom attributes to the part You will need to understand how to use twgl.js to use this feature at the createBufferInfoFromArrays function

indexCount: number = 0
indexData: number[] = []
material: Material
name: string
normalData: number[] = []
texcoordData: number[] = []
vertexCount: number = 0
vertexData: number[] = []

Accessors

  • set customArrayData(array): void
  • This is a very advanced feature, and allows you to provide your own twgl.Arrays This is useful for creating custom renderables from existing data

    Parameters

    • array: Arrays

      The twgl.Arrays to use for the renderable

    Returns void

Methods

  • Add a two triangle quad to the renderable part Each quad must be defined by 4 vertices and will get a normal calculated Each quad will get a unique normal, so no smooth shading

    Parameters

    • v1: XYZ

      Vertex 1 of the quad

    • v2: XYZ

      Vertex 2 of the quad

    • v3: XYZ

      Vertex 3 of the quad

    • v4: XYZ

      Vertex 4 of the quad

    • tc1: number[] = ...

      UV texture coordinate for vertex 1

    • tc2: number[] = ...

      UV texture coordinate for vertex 2

    • tc3: number[] = ...

      UV texture coordinate for vertex 3

    • tc4: number[] = ...

      UV texture coordinate for vertex 4

    Returns void

  • Add a triangle to the renderable part Each triangle must be defined by 3 vertices and will get a normal calculated Each triangle will get a unique normal, so no smooth shading

    Parameters

    • v1: XYZ

      Vertex 1 of the triangle

    • v2: XYZ

      Vertex 2 of the triangle

    • v3: XYZ

      Vertex 3 of the triangle

    • tc1: number[] = ...

      Texture coordinate for vertex 1

    • tc2: number[] = ...

      Texture coordinate for vertex 2

    • tc3: number[] = ...

      Texture coordinate for vertex 3

    Returns void

  • Build the part from the data added and turn into a twgl.BufferInfo

    Parameters

    • gl: WebGL2RenderingContext

      A WebGL2 rendering context

    Returns null | BufferInfo

    BufferInfo used by twgl

Generated using TypeDoc