Closed FishOrBear closed 5 years ago
In threecsg, Vertex expands the uv information and adds methods to achieve uv information reconstruction.
The code looks like this:
class Vertex extends Vector3 { constructor( pos: Vector3, public normal = new Vector3(), public uv = new Vector2()) { super(pos.x, pos.y, pos.z); } clone(): Vertex { return new Vertex(this, this.normal.clone(), this.uv.clone()); } lerp(v: Vertex, alpha: number) { super.lerp(v, alpha); this.normal.lerp(v.normal, alpha); this.uv.lerp(v.uv, alpha); return this; } }
I am trying to implement this feature in csg.js.
Since I will perform vertex merging now, I think I can only rebuild UV.
In threecsg, Vertex expands the uv information and adds methods to achieve uv information reconstruction.
The code looks like this:
I am trying to implement this feature in csg.js.