We are about to switch to a new forum software. Until then we have removed the registration on this forum.
It sounds like you are trying to create a wedding announcement with animated kinetic typography elements?
Designing a letter animation sequence like you are describing can be done in Adobe After Effects / Flash / Animate / Premiere, or even in Microsoft Powerpoint / Apple Keynote (with some limitations). https://www.thoughtco.com/way-to-make-kinetic-typography-140335
If you are truly a beginner you could also investigate pre-formatted kinetic typography of this kind, for example from RenderForest, and see if it meets your needs:
https://www.renderforest.com/templates?s=wedding
If you want to build it from scratch in Processing, you can -- for do-it-yourself, consider starting with the text examples and tutorials:
An example made in After Effects:
yes, the molecules are now getting attracted and repelling according to the heat slider value. However , I could not get the exact values for system temperature. For example, even at liquid state my system temp is showing to be around 250-300.
By complicated stuff I was just referring to your earlier reply. Currently that is getting the correct values of temperature and kinetic energy.
The java code is incomplete in the sense that I can't run it or even understand it because of the missing functions. The application was developed long back and we do not have the final source code.
@kfrajer :That's right, since Matter.js already takes care of velocity , imparting a random velocity externally is making the molecules overlap. Now I am applying instantaneous force instead of velocity(segment mentioned below).Thank you so much for this.
for (var i = 0; i < bodies.length; i++) {
bodynumber[i].position.x = bodynumber[i].position.x + 0.50*random(-1,1);
bodynumber[i].position.y = bodynumber[i].position.y + 0.50*random(-1,1);
}``
I am trying to build a model for solid/liquid/gas interactions as a part of a chemistry simulation. Could you please provide me an example of such a model that affects a molecule's kinetic energy. I thought I was doing that by increasing the velocity by 0.5*random every sec. However, that was clearly wrong.
Lin 133 in your code:
if(distforce > 40){
Matter.Body.applyForce(bodynumber[j],p2vector,diffvector);
}
I am afraid this is a very simplistic approach to handle your interactions. I am not an expert on this, but I can imagine that having a multiple bouncing system will get you in trouble as interactions are additive. It is after you loop through all the interactions in a single step (aka frame) that you will get the final position of each bouncing molecule. This final position could drive you into overlapping states. However, your code seems to fail even when the interaction is between two objects. You need to include some code that works not only on an "edge" interaction but on an actual overlapping interaction. There are two previous related java posts. With your js experience, I am confident you can manage reviewing these:
https://forum.processing.org/two/discussion/24966/bouncing-balls-collision#latest
https://forum.processing.org/two/discussion/comment/89968/#Comment_89968
I am not familiar with the matter engine design. I am curious to know how they handle interactions and collisions. They have a Detector function which seems to do this. If you haven't done so, you should consider checking their provided examples.
One last thing: What is the purpose of your code?
In a more real model, for solid/liquid/gas interactions, your slider value should be affecting your molecule's kinetic energy and not the attractive forces. In reality, the molecular interaction is based on a potential model, where the forces are based on distance. This is just a thought for your virtual experiment... implementing it could be an overkill if you are aiming to do a simple demonstration. There are other aspects of your code that needs to be considered before implementing a potential model.
Kf
I mean you - you are the expert now
And I think it's interesting if you have a computer with a kinetic running all the time you can have gestures for your room.
I am just curious
;-)
You will need either multiple ardunios or an arduino with more IO ports, like the Mega series. Check this post for example:
https://forum.arduino.cc/index.php?topic=146230.0
i'm thinking of realizing a kinetic sculpture
Can you provide more details about your project? How do you make a sculpture with arduinos and 2D noise?
Kf
hi, i'm thinking of realizing a kinetic sculpture, where i would need like 10 stepper motors which would simulate a 2d noise. is there a way to drive so many motors via arduino out of one processing script (simple noise for structure)?
Good to hear it is working again. It is bad that stuff like this happens and code stops working all of the sudden. It doesn't help that kinect support here in the community is not very much. Sooner or later, whatever the update did to break kinetic, will be resolved (fingers crossed).
For stopping windows updates, check this: https://www.google.ca/?gws_rd=ssl#safe=active&q=windows+10+stop+automatic+updates&spf=388
Good luck in your presentation.
Kf
One can see the aspect ratio of the TVs is not the same. Are you making sure you are dealing with the same aspect ration in your processes?
What are the values of KinectPV2.WIDTHDepth and KinectPV2.HEIGHTDepth? Do they match the image dimension?
Lines 27 to 31 can be changed to
for (int i = 0; i < KinectPV2.WIDTHDepth* KinectPV2.HEIGHTDepth; i++)
depthZero[i] = 0;
Notice there are no hard-coded values there.
Now, I am not an expert in kinetic and not familiar with the different values you are outputting there. However, I see the following discrepancy:
Your depthToColorImg is 512 x 424 or a size of 217088
What you get from kinetic is 434176 which is twice the value above. It must be because of the x/y data pair values. But then in line 67 you normalize it to your screen resolution. Why? From what I see, the object mapDCT is made of 2*(512x424) pixels (so are depthRaw and colorRaw but not relevant here).
Do you have a link to the documentation of your module? You should posted. Also cross link to any previous references: https://forum.processing.org/two/discussion/21624/combine-rgb-data-with-body-track-to-only-show-rgb-of-bodies-kinectv2-kinectpv2-library#latest
Kf
This is untested code below. What I do is I grab the depth value right at the center of the depth data (yes, only one pixel) and i used that to replace the effect of mouseX from your code.
Also search for other examples using https://forum.processing.org/two/search?Search=depthMap
Lastly, check Shiffman's videos on Kinetic: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZMlWHdcy8hAGDy6IaoxUKf
Kf
import org.openkinect.processing.*;
// Kinect Library object
Kinect2 kinect2;
PImage img;
//distance in cm depth, adapt to room
int distance = 1500;
int distance2 = 3000;
void setup () {
size (500, 500);
kinect2 = new Kinect2(this);
kinect2.initDepth();
kinect2.initDevice();
noFill();
stroke(255);
strokeWeight(2);
}
void draw() {
background(0);
PImage img = kinect2.getDepthImage();
image (img, 0, 0);
kinect.update();
int[] depthValues = kinect.depthMap(); //array, distances
translate(width /2, height/2);
beginShape();
int centerOfScreen= depthMapWidth/2.0+(depthMapWidth/2.0*depthMapWidth);
int currentDepthValue = depthValues[centerOfScreen];
float mappedVal=map(currentDepthValue,distance,distance2,0,width/100.0);
// add some vertices
for (float theta = 0; theta <= 2 * PI; theta += 0.01) {
float rad = r(theta,
mappedVal, // a
mouseY / 100.0, // b
70, // m
1, // n1
2, // n2
2 // n3
);
float x = rad * cos (theta) * 50;
float y = rad * sin (theta) * 50;
vertex (x, y);
}
endShape();
}
float r(float theta, float a, float b, float m, float n1, float n2, float n3) {
return pow(pow (abs(cos(m * theta / 4.0)/a), n2 ) +
pow (abs(sin(m * theta / 4.0) /b), n3), -1.0 / n1) ;
}
How do you want to connect this code with kinetic?
Also, check previous comments related to kinetic here: https://forum.processing.org/two/search?Search=kinetic
Kf
For the sound part:
Please install the Minim library using the Processing''s library manager. Then explore the examples provided by the library. You can access it through the processing IDE, open the menu Files >> Examples and then open the contributed libraries and search for Minim.
Check this tutorial: https://processing.org/tutorials/sound/
Alternative available functions: https://processing.org/reference/libraries/sound/index.html
For kinetic, explore previous posts to see approaches using your unit: https://forum.processing.org/two/search?Search=kinect
Kf
Does the library work with the provided examples? I am not sure if it will work with kinetic as I have no experience with that technology. My suggestion is to make sure the library works before you do the cross over.
Kf
You need to get the arduino working and it should be reading your infrared sensor. Does the infrared kit comes with any provided examples? What are the specs of your sensor and your arduino? How much have you done so far?
You can check previous post in the forum:
https://forum.processing.org/two/search?Search=infrared
https://forum.processing.org/two/search?Search=arduino
For the first one, you will get lots of kinetic code as well. Just focus in arduino posts. For the second search, you will have lots of arduino code to get you started.
Kf
@kfrajer: Thank you for writing about it. WeIl, I do not know anything about blobDectation but I would like to explore it. In addition to that, I have only heard of Kinetic but do not know what it is all about. I think I should see some Youtube videos about it.
For instance, install the blobDetection library using the library manager in Processing. Then you can explore the examples provided by the library and you will see a way to detect patterns in your image, in this case a puck or a ping pong ball.
For depth, you can use kinetic. You will need to acquire the hardware as well if you don't have one kinetic device.
Kf
Thank you, first problem solved! Does this mean that setup is ran after the variables outside the objects have been defined?
The other problem is this: A ball bounces. It loses energy with every collision, so it should be bouncing smaller and smaller amounts. And this amount is defined by the mE value, which I square in my code (kinetic energy -> velocity). It works fine when I have to swap the X speed after a hit of the side, but when it hits the bottom, it bounces up almost just as high as before, even though its Y speed is halved down after the hit. And if I decrease the speed to 40%, it bounces only half as high as before, so there is something fishy going on here. The maximum altitude should be v0/g, so the problem is with v0.
Im stuck here now.
Please describe your problem. You need to be specific, as most ppl will not be able to reproduce your problem because they will lack a kinetic unit.
Kf
I am not an expert in kinetic, but I notice you have a capture device and the kinetic device. From what I see in your code, you draw your kinetic image but you are processing the capture image (from the video object). If kinetic and the capture devices are not related at all, I would suggest you change line 25 with image(video, 0, 0);
and then next to this line add video.loadPixels();
.
For your mousePressed() function, it will be changed to this:
void mousePressed(){
trackColor = video.get(mouseX,mouseY)
}
You also need to add in your first line of draw():
if(movie.available()==true)
movie.read();
I am looking at this as a reference: https://github.com/shiffman/LearningProcessing/blob/master/chp16_video/example_16_11_ColorTrack/example_16_11_ColorTrack.pde
Kf
Do you have a link to your example you are referring to? You should provide it so people can access it. Maybe this next link could be relevant to you:
https://processing.org/tutorials/pshape/
Doign a search in the forum can also direct you to relevant posts:
https://forum.processing.org/two/search?Search=kinetic
Kf