Jump to content

Babylon mouse control


lakhi
 Share

Recommended Posts

Hi one of my post is still active though i am posting a new one again may be my last post was lost.

so as suggested by Deltakosh i created just a sample here 

https://www.babylonjs-playground.com/#VGUTRM#4

just to explain what i want. now if you see the line acts abnormally and rotates in 3d what i want is that the line moves with mouse cursor in 2d.

is it something that can be done?

Link to comment
Share on other sites

Here is your first post

In this post you gave the PG https://www.babylonjs-playground.com/#VGUTRM

This seems to stay in xy plane. Look at difference between the 2 PGs and camera creation.

Also in the above PG VGUTRM you can delete lines 1 to 7 they are not needed in a PG as the playground system deals with initialising the scene from the engine.

On mobile so cannot edit PG myself.

Link to comment
Share on other sites

14 hours ago, JohnK said:

Here is your first post

In this post you gave the PG https://www.babylonjs-playground.com/#VGUTRM

This seems to stay in xy plane. Look at difference between the 2 PGs and camera creation.

Also in the above PG VGUTRM you can delete lines 1 to 7 they are not needed in a PG as the playground system deals with initialising the scene from the engine.

On mobile so cannot edit PG myself.

this is just ugly codes just to show what i want.....i want to move a line in xy plane with mouse where one end of the line will be always at the same place and other end will move with the mouse.....when you are on pc and get some time can you pls create a sample for me in PG?

Link to comment
Share on other sites

9 hours ago, lakhi said:

i want to move a line in xy plane with mouse where one end of the line will be always at the same place and other end will move with the mouse.....when you are on pc and get some time can you pls create a sample for me in PG?

I just meant edit out lines 1 to 7. As far as I can understand PG VGUTRM already does this, the mouse moves and so does the end of the line in the system plane. Or do you mean that you want the moving end of the line to be always next to the mouse pointer? As you know and have in your code the end of the line moves in a circle whereas the pointer is free to move anywhere. Once you have moved the line you would need to reset the pointer to this position and  this is not possible - see http://stackoverflow.com/questions/4752501/move-the-mouse-pointer-to-a-specific-position.

Link to comment
Share on other sites

On 4/27/2017 at 1:31 PM, JohnK said:

I just meant edit out lines 1 to 7. As far as I can understand PG VGUTRM already does this, the mouse moves and so does the end of the line in the system plane. Or do you mean that you want the moving end of the line to be always next to the mouse pointer? As you know and have in your code the end of the line moves in a circle whereas the pointer is free to move anywhere. Once you have moved the line you would need to reset the pointer to this position and  this is not possible - see http://stackoverflow.com/questions/4752501/move-the-mouse-pointer-to-a-specific-position.

i m trying to build a pool game and i just want a line from cue to other balls where ever i point my mouse pointer the line should be from cue ball to the pointing ball.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...