26 lines
484 B
TypeScript
26 lines
484 B
TypeScript
import { Matrix2 } from './Matrix2';
|
|
import { Geometry, Vector2 } from 'three';
|
|
|
|
|
|
export function RotateUVs(geo: Geometry)
|
|
{
|
|
let roMat = new Matrix2();
|
|
roMat.set(0, -1,
|
|
1, 0);
|
|
|
|
let addV = new Vector2(1, 0);
|
|
|
|
for (let uvs of geo.faceVertexUvs)
|
|
{
|
|
for (let uv of uvs)
|
|
{
|
|
for (let v of uv)
|
|
{
|
|
roMat.applyVector(v);
|
|
v.add(addV);
|
|
}
|
|
}
|
|
}
|
|
geo.uvsNeedUpdate = true;
|
|
}
|