there is a torus SOP which is linked to a Geometry COMP. This Geometry COMP is connected to a render TOP which is then connected to an out TOP.
There is also one image in a moviefilein TOP which is connected to a null TOP. This is the background image.
How to combine the null TOP containing the background image and the out TOP containing the torus with each other so that the torus is draggable in the composition?
I combined these two operators with a composite TOP with the operation OVER and the tried with a mousein CHOP, select CHOP, panel CHOP, chopexecute DAT to move the torus, but it didn’t work.
What I would like to create is that the torus is placed on the right side of the screen and can be dragged with the mouse to the centre and then another image is displayed with transparency (from invisible to visible) or size (from zero to full size).
So I have the following questions:
How can the null TOP containing the background image and the out TOP containing the torus be combined with each other where the torus is positioned on the right side of the screen/on the background image?
How can the torus be made draggable/movable with the mouse?
How can the torus be moved to the centre of the screen so that another image is displayed (using transparency or size)?
Well I hope this is not for a class, but when I think of moving things around it is often best to think of 3D geometry and move it around in x,y,z either with a transform or in a geo. So if you solve for moving your torus first with mouse, you can put it in its own geo1 (see attached). Then I would put your background in a separate geo2. You can switch the image feeding this geo with a constant material and control the switch with your mouse position. Finally just render both geos. I am not quite clear on your third question, but you can figure that out.
Hope this helps. If you get stuck the Learn section here is really good to try out:
Thank you. Your explanation and tutorial helps a lot.
It is not a class work. I just want to try out new things like moving, combining and interacting with different operators.
Could I also ask you another question: Now, we have that when we move with the mouse to x=1.5 then image 1 switch to image 2.
If I have three images of which one of them is the background image, how can it be made that when the mouse reaches x=1.5, image 1 is displayed over the background image and when the mouse moves on to 2.5 the other image 2 is displayed but not image 1 ? Where and how can the range be specified ?
I tried it with a Composite TOP, but it didn’t work. I don’t know where and how the range for the individual images and the mouse movement should be defined.
Is it also possible to restrict not only the tx channels but also the tx channels of the mouse?
@anarts sorry for delay - deep into debugging my new piece last couple days. In Touch Designer there are usually several ways to accomplish the same thing. I would suggest a Switch TOP with an index that you scale with a Math CHOP to range and offset your mouse coordinate. Changing the index from 0 to 1 to 2 etc will route or switch any TOP images or movies etc you want. Watch this tutorial: Routing Your Content – TouchDesigner Curriculum
If you are not familiar with the Math CHOP yet it is a real workhorse and your best friend in calibrating various sensors and input devices etc. In electronics we call what his does gain (for multiply) and offset (for add or subtract). Check out a lesson here: CHOP Math – TouchDesigner Curriculum
I highly recommend the whole beginners learning set on Courses – TouchDesigner Curriculum so if you have not done those yet it will answer most of your questions. Another thing I do when stuck is just google something like “youtube - how to switch images with mouse movement” or whatever the best way to phrase your question is. In any given project, I usually have to consult the web many times. Another super resource is to look at the Op Snippets for any operator you don’t know well yet - to see how it works. top menu Help/Operator Snippets. Invaluably learning resource and you can cut and past the example that is closest to what you want to do then tweak it to suit your purposes.
Good luck and enjoy experimenting with TouchDesigner - my all time favourite program!