Skip to content

Face4 incompatibility with threejs r60+ #13

@deathcap

Description

@deathcap

three.js r60 removed quads (Face4), for compatibility it can be replaced with two triangles (Face3):

https://github.com/mrdoob/three.js/wiki/Migration

r59 → r60
Face4 removed. Use 2 Face3 to emulate it.

if (q.length === 5) {
  var f = new this.THREE.Face4(q[0], q[1], q[2], q[3])
  f.color = new this.THREE.Color(q[4])
  geometry.faces.push(f)

something like:

if (q.length === 5) {
  var f = new this.THREE.Face3(q[0], q[1], q[2])
  f.color = new this.THREE.Color(q[4])
  geometry.faces.push(f)

  var g = new this.THREE.Face3(q[3], q[2], q[1])
  g.color = new this.THREE.Color(q[4])
  geometry.faces.push(g)

but the faceVertexUvs (from this.faceVertexUv()) would also need updating accordingly

ref max-mapper/voxel-engine#74

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions