Hey guys,how to make webgl to render from top left corner coordinate instead from center?
here is my example https://jsfiddle.net/qy3572dt/
i know that i can set position of sprite to left top corner using (-1,1) webgl coords, but can i overwrite this behaviour like in canvas ?
What exactly do you mean with webgl coords? It seems to me what you are actually looking for is a way to translate the origin of a 3D object. For sprites, you can use Sprite.center in order to change the anchor point.
position, sprite.position.set(0,0,1); here 0,0 is webgl coords starting in center of screen, but i want it to behavious like normal canvas position, that starts from left top of screen
Possibly, you’re looking for what
THREE.Raycaster() does in its
.setFromCamera() method, including transformation of screen coordinates to NDC before calling it.
Something similar to this: http://discourse.threejs.hofk.de/2018/InteractionObjectHTML/InteractionObjectHTML.html
yes something like that,but not raycaster
btnNDC.x = x / window.innerWidth * 2 - 1;
btnNDC.y = -(y / window.innerHeight) * 2 + 1;
just need to figure out this coords, thank you for hint