Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
3D Ray Casting — Gideros Forum

3D Ray Casting

Hi everyone.


I love Gideros. I like how quick you can get from an idea to actual working code. I even managed to publish a gideros-made game on the google play store a few years ago ( working html demo here: miellaby.github.io/renabomb/web/gideros.html ).

But now I need help.

I try to make a new game using the recent 3D API of the latest Gideros releases.

Here is the repo of my work so far: github.com/miellaby/hitchScratch

Despite I have no background in 3d programming, I managed to make what I wanted (luckily I had no reason to use shaders).

But now I'm stuck with a problem. I need you help.

I can't find a way to compute what is under the mouse cursor (or the user finger). I know that this problem is an application of "ray casting" but it looks like maths way too complex for my limited abilities.

So, has anyone managed to make a 3D game where the user may point things in the 3D scene?

I will be very grateful if anyone could help me.

regards

Likes: MoKaLux, Apollo14

Tagged:
+1 -1 (+2 / -0 )Share on Facebook

Comments

  • MoKaLuxMoKaLux Member
    edited June 2019
    hello @miellaby sorry I can't help you but I have checked your game (html) and it is very fun. I only reached level 7 17.

    I am going back to it! great work!
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    Hi @miellaby, if your sprites are not in viewports objects’ hitTestPoint should work. Otherwise you can achieve what you want by computing the MVP matrix of your sprites and using Matrix:transformPoint(). Then filter out non matching x,y coordinates, order by z, and you are done.
  • @hgy29
    For your information, last time I tried hitTestPoint doesn't even work in 2D (it doesn't take rotation into account). I would be really surprised if it does the job.

    https : //github.com/gideros/gideros/issues/170

    Dislikes: kinrpg

    +1 -1 (+0 / -1 )Share on Facebook
Sign In or Register to comment.