xem / W

A micro WebGL2 framework with a ton of features
https://xem.github.io/W
330 stars 22 forks source link

Add raycasting to add interaction through mouse or touch #20

Open jaronwanderley opened 1 year ago

jaronwanderley commented 1 year ago

I don't know how to implement a raycasting using W, there is some functionality to assist with raycasting?. Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things. If hasn't some function, could u implement it or guide on a way to add it on the W?

xem commented 1 year ago

Hi! I'm afraid I won't be available to add this feature in the following month(s) because I'll be attending js13kgames (a js game jam) and work on several other projects after that. Though it's a very nice idea, to let the scene objects have click or even drag capabilities, so I'm adding it in my backlog :) In the meantime, if you're in a hurry, my WebGL guide (https://xem.github.io/articles/webgl-guide.html) explains how to do webgl from scratch, including mouse controls (in the part 2 - https://xem.github.io/articles/webgl-guide-part-2.html), and W.js is entirely inspired by that guide, so I would advise you to read it and use it to suit your needs (even without using W at all if it's simpler). Cheers!

jaronwanderley commented 1 year ago

thank u, I'll read it! I found this Library to add mouse control on webgl called glMouse, first I'll read your tutorial and try to implement using W or just webgl