Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

3D raycasting

Just a quick question, I haven't messed around with raycasting before, but I'm just wondering if it's possible to detect a 3D object relitive to the screen. Which I would assume would be through a raycast. Any information about this would help, cheers

Tagged:

Comments

  • Posts: 1,976

    3D raycasting would be a nightmare to code (and probably pretty laggy), but it's definitely possible. But what do you mean by "detect a 3D object relative to the screen?" There might be some alternatives that don't require raycasting.

  • Posts: 6

    Like for example if I could tap on a 3D object to "select" it, or even to see what 3D object is in the middle of my view, I'd guess one way would to compare the camera angle to the atan2's of the objects in the screen

  • Posts: 1,976

    @Peary @Ignatz found a way to find what object was touched without any math: https://coolcodea.wordpress.com/2013/05/30/70a-touching-an-object-on-a-3d-screen/

  • Posts: 6

    Ok, but I actually looked into the comments on a post you did on converting a 3D point to a 2D screen relative point and I think I am going to use that because it's a fairly straight forward. Thanks for your fast response I see you comment and help loads of people on here and I would just like to say thanks for helping the codea community be what it is today

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Peary - check out the recent posts on the right here. I've taken the best ideas off the forum to go both ways between 2D and 3D

    https://coolcodea.wordpress.com

Sign In or Register to comment.