Remember me
You are here: HomeForum
Welcome, Guest
Username: Password: Remember me

TOPIC: Using 3D mouse hit position

Using 3D mouse hit position 4 years 2 weeks ago #2421

  • minionboy565
  • minionboy565's Avatar
  • OFFLINE
  • Junior Boarder
  • Behold the truth ...and perish.
  • Posts: 20
  • Thank you received: 4
Hello.
I am working on a game with abilities and I wanted to use the 3D mouse position for it. Is there any way to use the 3D mouse position in the 3D world? I do not mean like only the X and Y of the mouse in the 3D world, but the X, Y, and Z of the mouse hit position. Here is an example (from Roblox):





Is there any way to use the 3D mouse position like in the video?
Thanks.
¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹¹⁰¹⁰¹⁰⁰¹¹⁰¹¹⁰⁰¹⁰¹⁰¹¹¹¹⁰¹⁰⁰¹⁰¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹(01101000 01100101 01101100 01101100 01101111 00100000 01101001 00100111 01101101 00100000 01101101 01101001 01101110 01101001 01101111 01101110...
The administrator has disabled public write access.

Using 3D mouse hit position 4 years 2 weeks ago #2422

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
Do you mean something like that:
www.gamemaker3d.com/editor/index.php?pid=01639817
You can see in the source how it has been done.
Regards,
Cyberix3D team
The administrator has disabled public write access.
The following user(s) said Thank You: minionboy565, TheSteveKid13-

Using 3D mouse hit position 4 years 2 weeks ago #2424

  • minionboy565
  • minionboy565's Avatar
  • OFFLINE
  • Junior Boarder
  • Behold the truth ...and perish.
  • Posts: 20
  • Thank you received: 4
I am looking for a way to use mouse Z too, not just X and Y. Sort of like a beam coming from the mouse pointer and going straight in the direction of the camera, stopping when it hits something. The object would be at the end of the beam. Is there a way to use the position of the end of that beam?
¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹¹⁰¹⁰¹⁰⁰¹¹⁰¹¹⁰⁰¹⁰¹⁰¹¹¹¹⁰¹⁰⁰¹⁰¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹(01101000 01100101 01101100 01101100 01101111 00100000 01101001 00100111 01101101 00100000 01101101 01101001 01101110 01101001 01101111 01101110...
The administrator has disabled public write access.

Using 3D mouse hit position 4 years 2 weeks ago #2426

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
We are sorry, but we don't have such functionality right now.
Maybe you can use this example to get something similar for what you need:
www.gamemaker3d.com/player?pid=04502423663
Regards,
Cyberix3D team
Last Edit: 4 years 2 weeks ago by cyberix3d.
The administrator has disabled public write access.

Using 3D mouse hit position 4 years 1 week ago #2443

  • Plazma
  • Plazma's Avatar
  • OFFLINE
  • Senior Boarder
  • 99 bugs in the programming code.. 99 bugs in the code..
  • Posts: 77
  • Thank you received: 19
this could be possible, using the example cyberix3d already made, you could draw a ray from the "cursor" straight on until it hits an object, then simply move the object being used as a cursor there.
Graphic designer and learning game developer.. I guess.
The administrator has disabled public write access.

Using 3D mouse hit position 4 years 1 week ago #2453

  • minionboy565
  • minionboy565's Avatar
  • OFFLINE
  • Junior Boarder
  • Behold the truth ...and perish.
  • Posts: 20
  • Thank you received: 4
OK, I think I found a way to do it, using the math.unproject but changing the Z so that it depends on the Y position of the mouse. It doesn't work completely the way I wanted it to, it still goes through objects, but I guess it will do.
Thank you, Cyberix3D for the math.unproject painting project with view source, it really helped.
¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹¹⁰¹⁰¹⁰⁰¹¹⁰¹¹⁰⁰¹⁰¹⁰¹¹¹¹⁰¹⁰⁰¹⁰¹⁰¹¹⁰⁰⁰¹¹⁰¹⁰¹¹⁰¹¹(01101000 01100101 01101100 01101100 01101111 00100000 01101001 00100111 01101101 00100000 01101101 01101001 01101110 01101001 01101111 01101110...
The administrator has disabled public write access.
Time to create page: 0.082 seconds