Please bear with me, I'm struggling to figure out this particular aspect while also trying to figure out array and classes. So I may be a little mixed up. I've taken the example script from my class last night and modified it to use a line instead of ellipse and whatnot so I can simulate the star trek warp effect a little. However, as I want to condense all of the lines to just a certain range of the rotate(), I'm just plain stuck on how to do this. I plan to move the translate() off to the right side for a better warp effect and I would rather limit the rotate() effect to just the angles toward the viewport. This condense the array of 3000 lines within just those angles rather than spreading a little too thinly.
The yellow line is approximately where I want to limit the rotate() to. How can I go about this?
Hi, everyone. I'm currently trying to study array and classes. But I just can't seem to quite grasp it. Right now my goal is to make a background like the warp effect seen in the YouTube link below
This is what I have so far and I'm working in increments. Right now I'm focusing on a single set of lines to loop back to origin as it reach the screen's edge.
int l=15; //line length
int x=0;
void setup() {
size(500, 500);
smooth();
}
void draw() {
background(255);
x++;
if (x>500){
x=0;
}
for (int j=0; j<500; j+=20) {
line((j+x)-l,50,j+x,50);
}
}
So far, I have a for array of the lines but the ENTIRE set of line go all the way past the edge of the screen before going back to the origin (int x). What I want is each line in the set to loop back rather than waiting for the last line in the set to pass through to the right.
As far as I can figure it out, I need to make an array of variables. Unfortunately, this is exactly where I'm tripping up. I can't seem to understand exactly how this work. I can make a basic for array but not with variable on what I know right now.
Once I have figured this out with your help, I plan to use another for array with rotate to spread this single line all over the screen to recreate the similar effect as in the youtube clip.
Thank you in advance for any advice and information.
Hi, first time posting here. Hope I'm in the right section. I'm currently developing a very simple interactive animation that could be easily turned into a game once I'm done with the basic structures. The main characters is a candle in a bird eye view of a dungeon jail.
What i want to learn how to do is to create a black overlay of the entire screen and have 3 or 5 ellipse connected to the mouse subtract from this black ovenrlay to give the illusion of the candle lighting up the room which is a background image.
I will be using some collision detections and arrays to create creatures (a simple black ellipse with eyes) that is afraid of the candle and would skirts the edge of the lights cast from the candle.
One of my concerns is that I do not understand how collision detection, arrays (producing multiple creatures, each with own seperate movements), and alpha overlay. I hope that maybe some of you could point me to a good guide on these three particular items because I seems to be a little confused in general by the stuff I've found online so far. I could see how I can use the codes provided but I do not know HOW it works so I can use the code properly.
Here is the beginning of my code so far. This consist of only the candle and the room's outline (I have a roughtly drawn room to be scanned and uploaded into the background later on).