Mouse position / mouse tracking (mouse cursor is not on same location as circle)

Hi,
I am quite new to TD (since january 2021) and hope that someone can help me. Attached you will find a .toe file of a circle that should follow the exact location of the mouse cursor. The circle follows the mouse location, but only in the middle of the screen the mouse cursor exactly is on the same spot as the circle. On other locations there is a gap between the mouse cursor and the circle. The more the mouse cursor goes to the edges of the screen, the bigger the gap between the mouse cursor and the circle gets.

How can I achieve that the mouse cursor and the circle are exactly on the same location?
Could someone send me the .toe file with the solution?

Thanks in advance.

Marcel

Mouse location test.10.toe (4.0 KB)

Welcome to the form @Beamblender!

So a big challenge here comes from out mouse coordinates are handled as well as how TOPs interpret normalized position. TLDR - the aspect of your texture and your screen are different, and so keeping things aligned is a little tricky.

For this very reason you might consider thinking about this in connection to a container COMP rather than your raw mouse position. With a panel CHOP you can take the rollu and rollv positions of a mouse over a container, and use that information to drive the position of your circle:

mouse

You can see how this is set-up in the attached toe file:
Mouse location test.toe (3.5 KB)

Hope that keeps you moving.

1 Like

@raganmd
Hi Matthew,
Wow, thanks for your help. I would not never have thought about this solution and was thinking about a Math or something like that. So within the container I can build the rest of my project?

My goal is to make an installation where I point a location with the mouse cursor. On that location an event (for example an explosion) will happen. The explosion will be projected with a beamer on a wall. On the exact spot of the explosion a laserbeam must hit. So the mouse cursor, the explosion and the impact of the laserbeam should be aligned. Lots of thinking and work to do for me.

Best regards,

Marcel Verbrugge
The Netherlands
Europe

You can build your project in a container, or reference it with a panel CHOP. I’d probably put all of the related elements in your container - just to make it easier to organize.

Working with normalized coordaintes / UVs will be a great help here for all of the texture elements. Calibrating your laser will be a little more work, but that’s where your Math CHOP will really come in handy. Hope your project goes well!

M

@raganmd
Aligning the mouse is the first challenge I have met now. Next is an in TD animated figure that follows the mouse, then an explosion in TD that occurs when I hit a mouse button and after that calibrating my laser. For calibrating my laser I have already gained some experience. I will certainly be back to this forum to share my experience and ask help.