let whiteArrowMaterial = new THREE.MeshBasicMaterial({
map: whiteArrowTexture,
side: THREE.DoubleSide,
});
let ringGeometry = new THREE.RingGeometry(5, 10, 32, 1, 0);
tankRing = new THREE.Mesh(ringGeometry, whiteArrowMaterial);
// I try this code
var pos = ringGeometry.attributes.position;
var v3 = new THREE.Vector3();
for (let i = 0; i < pos.count; i++){
v3.fromBufferAttribute(pos, i);
ringGeometry.attributes.uv.setXY(i, v3.length() < 4 ? 0 : 1, 1);
}
//
for (let i = 0; i < pos.count; i++){
v3.fromBufferAttribute(pos, i);
let u = Math.atan2(v3.x,v3.y);
let v = v3.length() * .2; //need scale factor based on ring thickness...
ringGeometry.attributes.uv.setXY(i, u,v);
}
But this shows another issue which is that the ring geometry is continuous… so the last segment in the ring loops back through the entire texture… and if you want the texture to animate across the ring… you’ll have to generate your own ring geometry… which isn’t too bad… I’ll see if I can throw that in a glitch… (oops I was wrong… this isn’t the issue… it’s the way im doing atan2 calc… )…
edit2: ok i fixed it by changing the ring geometry construction to start at a different angle and now it works since the atan2 sign flip is right at the seam.:
let ringGeometry = new THREE.RingGeometry(5, 10, 32, 1, Math.PI*-.5,Math.PI*2);
I’d also try a very flat open-ended truncated cone. It should have polar UVs by design. Rotation would be either via rotating the cone, or via changing the texture offset.