# Mouse node mapping problem

I have the Y pin of the Mouse node mapped to the Xtranslate of a quad. Moving my mouse moves the quad in the renderer.

It takes 10cm of moving the mouse with my hand to get the output from -1 to 1 on the Mouse node.

10cm is too small of a distance for me.

Is it possible for me to map the Mouse node to extend the range from 10cm to 20cm?

I hope you understand what I’m asking…

mpa_range_problem.v4p (4.7 kB)

Hi qwiks,
i don’t know if this is a possible solution, but
i think you need to use the “cycle mode” pin, on the mouse node.
and set it to “incrementcylce”. Then, you can use a map, and (if you want) a s+h with an if for detecting if you go behind the limits.

try this (i think this is not the best solution, but it works ;)

mpa_range_problem(2).v4p (8.7 kB)

ahhh! the S+H solution is very smart approach! I was trying to map this but could not figure this part out.

This solution works but it has its limitations. I’m using this as an interface for the public. The problem is that if you roll the mouse too far then try to roll it back the quad does not move again immediately until it comes back into range. This will confuse people. They will think the mouse is no longer working since they always expect immediate reaction when moving a mouse.

I think we are getting close… but still needs work.

@screamer thanks!

this is another way, the only “bug” is that the quad loops… but i think there is a solution ;)

mpa_range_problem(3).v4p (8.2 kB)

hello qwiks, you put the UniformScale in the transform tree at the wrong position, it scales the whole coordinate system and not only the size of the quad… also you are using the Mouse global node, which is relative to the whole screen. using the Mouse window node it will be relative to the renderer size… starting from there, you can map the range as you like…

mpa_range_problem2.v4p (6.0 kB)

hi,
i think i have the solution of your problem, qwiks. Is difficult to explain it, take a look on the patch, i think it’s ok for your needs ;)

mpa_range_problem(4).v4p (12.4 kB)

@screamer Thanks alot! great work! it works perfectly now! This is exactly what I was looking for. I’ve turned your patch into a module. maybe it may be useful for others as well.

I’ll have to take some time to study how you did this. I need to improve my skills in this area.

@tonfilm: thanks for pointing out the uniform scale problem. I know about the global vs screen nodes. screamer has figured out how to keep the quad from disappearing.

long live vvvv

mouse_map_module.v4p (11.9 kB)