TrackBall with JavaScript

mfreakz's picture

Hi, I would like to make a macro-patch or a Javascript patch that do the same thing as the native "TrackBall patch" but with an X, Y and trigger input. I'm interested by all the settings such as: Sensibility, inertia and friction. I just want to control such a new TrackBall patch with others controlers than the mouse. I don't know how to code that in Javascript, but i think that a Javascript patch linked to a 3D transform patch should works isn't it ? Thanx for your help !

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture

yanomano made a mouse/javascript combo that does this -- maybe he can chime in with how it works?

yanomano's picture
Trackball but without inertia

I have done a Sort Of 3D setup to bring inside QC a "3D software like interactivity". It provide shortcuts to zoom, rotate and translate the viewver (you have to put you scene inside a macro before) A menu give you the choice to display you scene in differens modes : perspective, top, bottom, front, back, left right... But there is no inertia or friction functions because it is just a GUI to help for 3D modeling. The QC3D_GUI was published on kineme long time ago. Tico Ballagas is the author of the javascript that provide mouse coordinates accumulation. I hope the file could help you. Regards.

QC3DGUI.qtz297.93 KB

mfreakz's picture
Merci !

Merci (i'm French like you !) I will start with your composition, it's very helpful for me. I will tell you back if i found something for inertia.

psonice's picture
Smooth for inertia?

Can you not just add a smooth to each rotation/zoom/etc parameter for inertia?

gtoledo3's picture
Oh, it seems like I remember

Oh, it seems like I remember this from some kind of particle tools example?

This was really clever!!!! It would probably save me a bunch of time using this as a starting point.

Now I just have a to do a "fubar" version with some ortho and fov, and it will be all set :o)

gtoledo3's picture
Can we just not add a smooth

Can we just not add a smooth for inertia? ;o)

mfreakz's picture
Smooth Patch won't run over values...

In the TrackBall Patch, Inertia run values over mouse values and decrease or just keep running (it depend on the "Friction" settings). A Smooth Patch will only slow down and modifie velocity of my mouse value, it will not run over or loop movement... I can't code that, but i think a javascript could do those kind of effect. With this JavaScript or Macro-Patch special TrackBall, we could play with 3D objects with other controlers... OpenCV !!!! We can make QuicktimeVR like stuff with less limitations... HELP !!!!

leegrosbauer's picture
Re: Trackball but without inertia

I'd like to use this QC3DGUI patch in a third party application as opposed to using it directly in Quartz Composer. I would like to bypass the mouse patch and instead simply utilize X Position, Y Position and the Left Button boolean as published input ports. I've done all the bypassing and the port publishing and everything seems satisfactory, but only so long as the composition is open in QC with the composition viewer selected as the foremost window.

Edit: Hmmm. I see I've probably asked a dumb question. pffft. Ignore it. That said, I'll report that I've arrived at a satisfactory solution for my own needs by simply using the 3D Transformation patch and modifying the X and Y Rotation input values with Math patches. I'm happy.