Looking for help positioning sprites at the bottom center of the orthographic camera.
Here is the current setup -
The object:
function Obj() {
const texture = useLoader(THREE.TextureLoader, loadedimg);
const spriteRef = useRef();
return (
<group>
<sprite
position={[1, ???, 0]}
ref={spriteRef}
scale={[texture.image.width * 1.5, texture.image.height * 1.5, 1]}
>
<spriteMaterial
attach="material"
map={texture}
sizeAttenuation={false}
/>
</sprite>
</group>
);
}
The camera rendering:
<Canvas orthographic camera>
<Suspense fallback={<React.Fragment>loading...</React.Fragment>}>
<Obj />
</Suspense>
</Canvas
Struggling to find the right calculation to position sprites at the bottom center consistently due to differing heights. Looking for a solution that works for all sprites, rather than specific adjustments for each. The center
attribute doesn't seem to provide the desired results based on the documentation. Any guidance is appreciated!