Quartz Composer Physic | Collision

biro's picture

Hello everyone, I'm trying to simulate a physic system with collision detection in quartz, but with no results.

First thing first. I've downloaded the ParticleTool from the download section, with no results. Quartz is unable to find the tool in the library. (i've a mbp with os x 10.6.7 and the 0.3 version of particle tool) Despite this, i've decided to try with javascript (i'm feeling more comfortable with javascript or ActionScrip, and i found a lot of examples for them)

the question is: How can i do that with quartz? and if there's no way to make ParticleTools working on my mac, how can i do it with javascript?!

and why did apple made no user manual about quartz?! :(

Thank You so much!!!

cybero's picture
Re: Quartz Composer Physic | Collision

biro,

if you can't find the patch in your library then you ned to duplicate your copy of QC, select it's icon, press command + i and set the application duplicate to run in 32 bit mode. if you still can't find the patch in your library with this 32 bit version of QC, then you probably need to reinstall the Particle Tools plugin.

biro's picture
Re: Quartz Composer Physic | Collision

i did it, but still doesn't work :( is there an "old school" method to check the collision like in javascript or something like that?

dust's picture
Re: Quartz Composer Physic | Collision

you might want to check out some of these links.

t-linked's bullet physics engine plugins.

http://kineme.net/forum/Discussion/Programming/BulletHelloWorldexample

look at franz's box2d plugin that does some collisions in 2d like the above link.

http://1024d.wordpress.com/

there is m.oostrik boids examples the boids do not actually collide but you check to see if they will collide in order to change velocities and stuff like that.

http://kineme.net/composition/MOostrik/OpenCLBoids

there is GT's rectHit. it is a hit test to check if your mouse has collided with an object.

http://kineme.net/composition/gtoledo3/RectHit

there is my 3D collision tests.

http://kineme.net/composition/dust/OpenCL3DVertexCollisionhittesting

there are some good particle collisions at the bottom of this thread. http://kineme.net/composition/dust/ParticlePhysics

when i started qc i had the same question where is the physics etc.. me being used to unity and maya etc where gravity is just a button you turn on, didn't really realize in qc you sort of have to roll your own physics engine.

i took a class in physics modeling not really knowing physics or calculus at all. the first day of class my jaw dropped the teacher didn't use a computer in computer simulation class, not even for overheads. it was all chalk board notation's of mathematical and physics laws and how to numerically and analytically solve and predict outcomes and conserve energy. my last project was a molecular simulation. after taking this class i realized a few things.

one qc has physics built right in it stock. with inertia, force, springs, and constraints patches that you can apply to any object. and secondly open CL is awesome for applying those things to a whole bunch of objects at one time plus writing out your code is shorter when using CL in 4D than breaking things down and going component by component. sometimes this is unavoidable though.

as per old school method your suggesting. go with the search term "javascript hit test" on kineme and just get started testing for collisions. really its what happens after the collision that is important as testing for a collision isn't the hard part. some simple heuristic things could be simply reverse the velocity of an object on collision to bounce off etc..