react-three-renderer icon indicating copy to clipboard operation
react-three-renderer copied to clipboard

Example for Sprite

Open nickpolet opened this issue 6 years ago • 1 comments

Hey,

I don't really like using this place for help and not bugs etc... but I'm really struggling get a sprite to display. Does someone have an example of working with a simple sprite?

Currently I have something similar to:

<sprite visible={true} position={new THREE.Vector3(0, 0, 0)} key={"sprite_" + index}>
    <spriteMaterial side={THREE.DoubleSide} color={0xffffff}>
        <texture url={element.image} />
    </spriteMaterial>
</sprite>

I don't get any errors, but the sprite doesn't appear at all. The url is a valid url and works fine on a meshBasicMaterial on a plane.

Any help would be great.

------- EDIT -------

I get an error in chrome console that mentions:

THREE.WebGLRenderer: Texture marked for update but image is incomplete

image

Not sure if that is related at all?

nickpolet avatar Mar 02 '18 11:03 nickpolet

There is an example of sprite use with react-three-renderer in this stackoverflow question, maybe it could be helpful somehow

https://stackoverflow.com/questions/39236107/sprite-labels-with-react-three-renderer-mvce-included

supromikali avatar Dec 05 '18 10:12 supromikali