The following MovieMaker code works in 0194. I just installed 2.0a4 and tried MovieMaker but it says, "Cannot find anything named "MovieMaker.H263" Is this a feature in development or has it been replaced with something else? The MovieMaker reference for 2.0+ indicates that it should recognize 'MovieMaker.H263'. I did not see anything in the release notes about MovieMaker.
import processing.video.*;
MovieMaker mm;
void setup() {
size(720, 480, OPENGL);
mm = new MovieMaker(this, width, height, "drawing.mov",34, MovieMaker.H263, MovieMaker.LOSSLESS);
}
void draw() {
translate(width/2,height/2,0);
fill(255,150,10);
sphere(50);
mm.addFrame();
};
My apologies if this is not the correct forum to post questions about alpha releases.
I'm wondering if processing can be used to develop facebook FBML content. I know nearly nothing about FBML but its Facebook's version of a custom web page. I don't know what it's capabilities are, but, I am curious if anyone in the processing community is aware of using processing in connection with content displayed on a facebook page. Could/is processing being used for facebook application development? Are there libraries in development for working with facebook?
I thought I've correctly declared fields and methods accessing the ani library but I get the following error:
java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks) ### Ani Debug -> Error @ AniCore. AccessControlException. you are probably running in applet mode. make sure fields and methods which you want to access in your processing code are public.
java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks) ### Ani Debug -> Error @ AniCore. AccessControlException. you are probably running in applet mode. make sure fields and methods which you want to access in your processing code are public.
This error occurs each time I call the following functions that have calls to the ani library:
The error does not stop the sketch from executing, the above functions work for their intended purpose but I would like to use the debug console and would like to prevent these continuing Ani:AccessControlException. It looks unprofessional.
I have svg graphics consisting of a simple filled and stroked path with 10 - 30 bezier curve control points created with Inkscape (outlines of dolphins and octopus). I want to use svg graphics because of their scalability (and control over color, stroke, and transparency). I haven't learned how to use processing bezier's or to convert my svg's to beziers and it's a lot easy to create artwork as svg's.
I want to be able to rotate these svg's but not around their corner's or svg document center. Whether I use shapeMode(CENTER); shapeMode(CORNER); or //shapeMode(CORNERS); my svg's don't rotate in place. They also look kind of funky when rendered in P3D with smooth();
It would be nice to load them into processing as beziers ... is there a library or a processing sketch that outputs the bezier information from an svg into processing bezier() statements that could be cut and pasted into a sketch?
Sorry, codes kinda worthless w/o the svg's but couldn't figure how to add them to this post:
It's really going to put a strain on my noggin if you have to translate x and y as a function of it's current rotation in order to get svg's to rotate in place.
With several projects I wish to display several images that have different width's and height's in the center of the sketch window. Many of the images are larger than the screen resolution (at times in the sketch parts parts of may be displayed at higher resolutions though other functions.) Sometimes the widths are wider than the screen resolution; sometimes the heights are; sometimes both are.
I need to center and scale different sized images in the sketch. Since all we are dealing with is rescaling images according to what the sketch height and width height are, it MUST be possible to construct a forumula that would always display an image in the center of the sketch, scaled to fit inside the screen, when it wider or higher than the sketch window. Like it would scale by whatever the largest dimension is.
I've been picking my brain writing all sorts of different variations of ideas and haven't come up with a formula that scales the images correctly. E.G.:
It seems to me that this would be a fairly common project requirement and that someone could share their autoimage center solution. Before spending another evennining trying to figure this one out, I thought it wouldn't hurt to ask.
I think by the time I come back to this question, I'll have worked out a solution but I'm still interested in how advanced coders would do it.
I can't seem to apply a tint to opaque grayscale images. Am I doing something wrong here? I have transparent black and white images of left and right wings. I want to be able to change the wing colors and I thought the simplest way would be to use neutral tone colors and apply tints to them.
Is there any obvious reason why I am getting this error (eventually) from my script:
Note: I have three separate SoundSipher Melodies going on here and I am learning about how to control the start of play of each melody so the melodies start at the same time or could be offset from one another.I don't get the error when line 139 is uncommented and line 169 is commented. This line marks the beginning and ending of a SoundSipher melody. I think what is happening here is it's nesting part of a melody when I play the first melody when I put Melody.play(); on line 169 followed by Melody2.play();
I am having a hard time by listening whether the location of [sounsipherscore].play() in connection with other score's has any effect on the timing of when each score starts playing.
Do you have to use constraints to prevent changes to pitch, tempo, and instruments which in certain combinations cannot be handled by java?
# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d5da37e, pid=5020, tid=4932 # # JRE version: 6.0_20-b02 # Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 ) # Problematic frame: # C [jsound.dll+0xa37e] # # An error report file with more information is saved as: # C:\Program Files (x86)\Processing\processing-1.2.1\hs_err_pid5020.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
/**
* UNTLS (BSD 2011)
Music Class for Java Applets and Applications
* Based on GeneratingBeats and Unlimited Art SoundCipher examples
* by Andrew R. Brown.
* A drum pattern generator that creates a 4 beat pattern,
* plays it then generates another 4 beat pattern, and so on.
* SoundCipher's callback facility is used to provide the loop
* regeneration notification at the end of the pattern.
* Simple drawing in time with the music is triggered by callbacks.
I'd like to incorporate local police scanner radio into a news aggregator (designed to be run as an application). Local scanners are available online for a variety of players (flash, java, real audio, winamp, windows media, etc.) at http://www.radioreference.com/apps/audio/?feedId=7047
Is ESS the only Processing library for playing streams? The Ess example at http://www.tree-axis.com/Ess/_examples/mp3Stream/ requires an mp3 stream. I've never gotten it to work and the example has never played sound for me. If there's a simple way to do this with ESS by cutting and pasting the proper address for the stream from http://www.radioreference.com/apps/audio/?feedId=7047 please do so and post what that mp3 radio urls or any modifications to the above ESS example for working with a different stream.
A java player is available so I am reasonable certain there's a java library or two for playing streams. What are the best ones for working with from within processing? For working with the formats available at http://www.radioreference.com/apps/audio/?feedId=7047?
All I need are stream stop and play features; no pause or fast forward features. Ideally, I'd like to merge the stream with ambient background generative sound created on the fly with soundsipher sota similar to this example: http://youarelistening.to/ which merges LAPD scanner radio with ambient music.
Sorry about this post title .. I'm LOOKING for a generic two person fighting game script I can use to MAKE a Sheen/Norris fighting game. I think it would go over well. I've seen lots of 'Street Fighter' knock off's ... there's gotta be something like that for processing but though I look and look, I haven't seen anything here on or openprocessing.
I think many people would be interested in exploring a Sheen / Norris fighting simulation even if it were just very simple.
My apologies if you came here looking for a complete simulation. Try collaborating. How about any ragdoll physics engines for processing?
I'm having trouble creating a class out of a Soundsipher example code that uses callbacks. When I try to setup callbacks the usual way, myScore.addCallbackListener(this); it says I can't create a callback. I also have a question about assigning instruments using instrument names. This question relates to the Soundsipher library, but, may be generally relevant to creating and using classes in general.
I've commented out the lines that would turn the script into a class so that the following script executes. The string list is not being used; that's my second question.
It's line 62 that causes the error, and I suspect lines 77, 81, and 91 would too if it executed that far as these lines also add a callbacklistener.
I've done a little exploring and found there's things like 'ActionListeners' and something about needing to create callback classes.
Soundsipher requires callbacks in order to use the score mode. (Lines 160-177.) The callbacklistenerclass I created when I had things uncommented to run as a class, lines 218 to 238, wasn't available from inside the MusicMaker class.
/**
* UNTLS (BSD 2011)
Music Class for Java Applets and Applications
* Based on GeneratingBeats and Unlimited Art SoundCipher examples
* by Andrew R. Brown.
* A drum pattern generator that creates a 4 beat pattern,
* plays it then generates another 4 beat pattern, and so on.
* SoundCipher's callback facility is used to provide the loop
* regeneration notification at the end of the pattern.
* Simple drawing in time with the music is triggered by callbacks.
//public class handleCallbacks implements ActionListener {
//
// handleCallbacks (int callbackID) {
// switch (callbackID) {
// case 0:
// //score.stop();
// myScore.stop();
// makeMusic();
// break;
// case 1:
// float w = random(20);
// r = new float[] {50-w, 50-w, w*2, w*2};
// redraw();
// break;
// case 2:
// r = new float[] {20, 20, 60, 60};
// redraw();
// break;
// }
// }
//}
My second question is, when I do Melody2.instrument(Melody2.STEELDRUMS ); it works to change that melody to use SteelDrums. What I would like to do is Melody2.instrument(Meldoy2.ListOfGoodInstrumentNames[random(ListOfGoodInstrumentNames.length)). Also, Melody2.instrument(XX) where xx is an integer works to assign an instrument. ? There's a list of the assignments to instruments here:
These don't look like integers. Is there a trick to using instrument names instead of instrument numbers that are stored in a list of instruments to be used?
I'm working on code to render the path of the sun and moon where they travel slowly at the top of the screen and move faster as they approach the horizon at 1/2 screen height. What I've got is working, but, about every three iterations through the calculation of y for the position of x, it generates a NaN error.
What is a NaN error? What does the acronym NaN mean? What effect do they have on memory use? Is it necessary to trap them?
float x;
float y;
void setup() {
size(600,200);
noLoop();
//frameRate(1);
x = width;
y = height/2;
}
void draw(){
ellipse(width/2,height/2,width,height);
ellipse(x,y,10,10);
//
for (int i = 0; i <= width;i++)
{
x = width - x-i;
y = -((float)(height/2)/(width/2)) * sqrt((float)sq(width/2) - sq(x-((float)width/2)))+height/2;
if (x <= 0) {x *= -1;}// y *= -1;}
//if (y <= 100) {y *= -1;}
ellipse(x,y,14,14);
ellipse(x,height-y,14,14);
println(str(y));
}
}
Ultimately, Im going to synchronize the movement with a clock and sunrise and sun set times scraped from a weather info site. If I am unable to figure out how to use javascript code for calculating reasonably precisely the moon and sun setting and rising times. Apparently, the phase of the moon can be calculated (instead of scraped) so I figure the sun rise and setting times might be calculatable as well. Whatever, I'm still interested in knowing more about NaN.
Is it possible to randomize the order of items in an array? I have an array list of the names of 16 7k images which I load into an array of PImages using loadImage in a loop in setup().
In draw(), I loop the array of PImages called sprites to draw each image.
What I'd like to do is draw the images in a different order than they are stored in the PImages array. I want to re-sort randomly the sprites array, e.g. make a copy of the sprites array, randomize the order of elements in the copy, and then instead of looping through the original array in draw, I loop through the copy with the randomized order.
I know how to copy an array. I just don't know if there's a clever/convenient way to randomize the order of elements.
Or, would it be better not to copy an array of PImages. Instead create a new integer array called spriteorders where each integer is the index of an image in sprites array and then do something like image(sprites[spriteorders[si]],0,0), if that's possible. Does creating a copy of an array of PImages bloat memory with additional loaded images or does it know the images are already loaded?
Or, instead of copying the arrays, I could do a "knuth shuffle" with something like SpritesRandom.add(sprites.remove(int(random(0,sprites.length)))) ; ??
Here's the full code: http://pages.suddenlink.net/tls/stevo_applet/ (not current but has all relevant parts). It throws an intermittent exeception java.net.MalformedURLException: no protocol: loading.gif on startup sometimes; refresh usually clears it.
I'm modifying someone's script here to show many different images instead of one image of a ball. The following code was working fine until I added in the three lines 21-23 and commented out the lines below; I may want to use more or different images and want to be able to select random images so I would preferable put the names of the images to load in an array of file names, and then in setup do a for loop on each of the names through loadImage(StringArray[index]) ..
I think lines 21-23 broke my code. It throws a NullPointerException. Do I need to set up the size of sprites somewhere before adding to it?
Is there a forum for Processing.js? If it is supposed to be the one at Google Groups I am not happy. Is it appropriate under this forum or another forum at forum.processing.org? (There's a choice for Android Processing but not for Processing.js?)
Processing.js is at a different host. There, I don't see detailed instructions on where to extract the zip files and use them with a local host interface to write and execute the code. I _thought_ I saw some instructions a few months back (on a processing.org page?), but, I haven't found them yet. There was something about installing to the proper location and then the processing editor will detect their presence and add additional html5 and .js save as features.
I imagine there are best protocols for installing depending upon whether you are a processing .pde editor or using eclipse. For processing, I'd like to know as much as possible so that I can share data used by sketches between .js and vanilla exported .pde. Should I organize projects and sketches under different folder trees for .js and .pde sketches? Is it better to use processing.js with eclipse for some reason? Do all I need to do is associate Processing 1.2.1 as the application to use to open .js files?
If there are any installation guides for processing.pde users to install processing.js and use it with their existing projects, PLEASE POST LINKS HERE for errant dummies like myself who don't understand "Processing Implementations."
This is an application I am developing with Processing.org for traditional media artists to display their works online with somewhat safer protection/retention of intellectual property. It would/should provide most well known methods for protecting ip rights on public websites. It's best for
displaying paintings and drawings on canvas, paper, or other two dimensional media
where the vale of the art is as a piece on media for hanging on display where it can be affected by the light and shadows of the environment. The resolution necessary to display artwork in a web browser is nothing approaching the resolution (and corresponding file size) to display as it appears in real life.
When images are displayed through java applet, the entire .jar file is downloaded to the appropriate cache on the viewers machine. Each image shown by this player is stored in one .jar file. From my limited experience, .jar files are even easier than hack than flash files. The images can be extracted. Theoretically, the slideshow could then be re-created by running this open source script on the extracted images to create a new slide show.
I'm not sure, but I
believe using signed certificate applets is supposed to be able to allow
you to use up to 128bit encryption for packages with fully trusted and signed
certificates. That would take some time to hack with dedicated
equipment. But, even if you want to limit allowed viewers to hosts with signed certifcates, the images are not encrypted for the hosts with signed certificates.
When displaying original art on the internet, it's always a good idea to watermark your images. It is not necessary to use watermarks that are visible to the naked eye. In fact, some of invisible watermark technologies are better. Virtually any container or package containing images displayed on the world wide-web can be hacked to extract it's contents.
Even still, while processing carries the inherent limitations of .jar contents security, methods such as scrolling text, the use of a magnifying lens to show only part of an image at a time in higher resolution, jigger, caption overlays, barely noticeable distortions, display of copyright information, can convey to the casual viewer the essence of the artwork while leaving a sense that they still need to see the artwork displayed in it's native format.
Design criteria are that it be relatively easy to add images and descriptions, include 'plug and play' style for adding effects classes, and include easy to modify routines for animated text. It should provide watermarking; this script does not read and write watermarks to the digital images distributed in the applet. It should be able to detect whether images have been watermarked so it does not re-watermark them; but this script does not have that ability.
Another Slideshow Player is obviously incomplete without tools to determine whether it is being run under a specific signed security applet. If used as an application, it should have some way to determine if its running on a proper host. It would be nice too if it could delete itself after a specific time period.
For faster display at start up, this app may be a good candidate for processing.js as when running as javascript or html5 because these technologies may allow for the program to start executing draw before all images are downloaded. That could compromise whatever security packaging in applets provides, but, maybe javascript and html5 have better packaging security methods to explore. Processing.pde and libraries have a way to make chunked up .rar files that are read sequentially that should be explored.
On the other hand, it may still be preferable to maintain images of artwork for display on the internet deep in the bowels of some lamp server with https and ssl that only serves one image at a time, as requested by the script or host, rather than providing a package of all images.
I would welcome comments, coding errors (I know there are many), tips for watermarking and protecting intellectual property of images displayed within processing, as well as any offers to purchase originals of the fine artwork displayed.
Also, Credits are due to the authors of 'Magnifying Glass', liquid water, and 'boids'. I've modified these to run as classes. The names were included in the respective codes but I'll try to look them up and include them once this app is finished. I'll be updating the app from time to time at the same address above.
The following code works (if you have the class water_surface anyway). However, I want to change the image used by the class interactively or with a timer. For this, I thought of using a switch case situation. Unfortunately, if I uncomment the commented part of the code, processing throws a generic processing.app.debug.RunnerException: unexpected token: void at processing.app.Sketch.preprocess(Sketch.java:1326) at processing.app.Sketch.preprocess(Sketch.java:1205) at processing.app.Sketch.build(Sketch.java:1568) at processing.app.Sketch.build(Sketch.java:1553) at processing.app.Editor$DefaultRunHandler.run(Editor.java:1485) at java.lang.Thread.run(Thread.java:619)
error and highlights the line containing : void setup(){
I've looked the switch...case over and compared it to other working code and the only difference I can see is that I am calling a class in the switch statement. There doesn't seem to be a problem calling the class in draw outside of the switch...case statement. Is there something in the switch...case statement that I am missing?
This isn't a complete sketch; it's a class that displays the phase of the moon which can be easily incorporated into sketches. You could change the url and pull in any image from the web. It refetches the image every two hours.
In your main sketch, declare the class: MoonImage myMoonImage; In your main setup, call the class: myMoonImage = new MoonImage(width-((width/4))+60,(height/2),#3FB748,255); You can set it's position; tint() and transparency. In your main draw, call the drawmoon: myMoonImage.DrawMoonImage();
It doesn't calculate the moon phase, it pulls an image from http://tycho.usno.navy.mil//cgi-bin/phase.gif which seems very reliable. Accordingly, it won't work online unless you set up a proxy, wget, or similar.
It loads the image 'socket_1.png' if it can't fetch the moon (it hasn't happened yet). You need an image called socket_1.png in your data directory if you want to placeholder image when the phase isn't available. Otherwise, comment out line 44.
public class MoonImage {
int x,y;
color c_back;
int moonalpha;
PImage ImageSource;
PImage NoMoon;
String URL;
int UpdateInterval;
int LastUpdate;
public MoonImage (int xtop, int ytop, color color_c, int m_alpha) {
I modified someone's clock sketch (sorry, the source doesn't mention authorship and I forgot where I found it) to be a class (one of the recommended ways to learn about classes is to covert sketches to classes). I've noticed that maybe 30% of the time I launch my app containing this class, that I get a ClassNotFoundException with this or one of several other classes used in the sketch.
So first, as a general issue, what can cause a sketch to generate class not found exceptions on an intermittent basis -- sometimes the sketch runs fine and other times it acts as if a class were not defined or present in the sketch?
Second, what do the numbers at the end of each line in a debug window mean? I thought they were line numbers, but, if they are, they are useless in the processing.org editor if a sketch has multiple separate files organized as tabs because the line numbers count all the lines in the sketch sequentially, but, when looking at a sketch in the processing editor, the code in each tab begins with 1.
Here's what I get when it can't find a class:
processing.app.debug.RunnerException: ClassNotFoundException: Feed_Reader$Clock at processing.app.Sketch.placeException(Sketch.java:1543) at processing.app.debug.Runner.findException(Runner.java:582) at processing.app.debug.Runner.reportException(Runner.java:558) at processing.app.debug.Runner.exception(Runner.java:498) at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367) at processing.app.debug.EventThread.handleEvent(EventThread.java:255) at processing.app.debug.EventThread.run(EventThread.java:89) processing.app.debug.RunnerException: ClassNotFoundException: Feed_Reader$Clock at processing.app.Sketch.placeException(Sketch.java:1543) at processing.app.debug.Runner.findException(Runner.java:582) at processing.app.debug.Runner.reportException(Runner.java:558) at processing.app.debug.Runner.exception(Runner.java:498) at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367) at processing.app.debug.EventThread.handleEvent(EventThread.java:255) at processing.app.debug.EventThread.run(EventThread.java:89) Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: Feed_Reader$Clock at Feed_Reader.setup(Feed_Reader.java:111) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PApplet.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: Feed_Reader$Clock at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 4 more
Here's the block of code in my main sketch's setup() where I call some of the separate classes used in the sketch; note myClock on line 3:
myMoonImage = new MoonImage(width-((width/4))+60,(height/2),#3FB748,255);
myRadarImage = new RadarImage(260,50,#3FB748,255);
myClock = new Clock(width-((width/4))+60,(height/2),105);
myTrafficCams = new TrafficCams(width-((width/2))+45,(height/2)+13,172,128,255,255,4);
myWeather = new Weather(260,65,#3FB748);
myWaves = new Waves(4,100,#3FB748);
myTides = new Tides(12,134,#3FB748,60);
Sometimes the classnotfoundexception occurs for one of the other classes and I don't think it's caused by a bug in a particular class, but, for example, here's the myClock class being called:
public class Clock {
float d, mm, wCen, hCen, Cir, CirR1, CirR2, CirR3;
Not knowing any better, I've thought about putting delay(1000) in between calling each class in case it was a problem with loading too many classes too quickly. In case you're wondering, it's a localized news aggregator with visualizations for wave height, sunset, moonrise ... still very much underdevelopment.
Here's an example of video applied to a sphere in a music player applet. Project is on developmental hiatus while I refactor the code. May have mini-games on each level. There's some (tearing?) graphical glitches on the earth 'align planets' level --- press '5' on the keyboard to skip to the movable planet level. I don't think its tearing ... the technical name skips me at the moment but its where instead of seeing the outside of the texture applied to a sphere, you see the texture on the inside of the sphere. Here, it depends on where the earth sphere is; if it's close, then everthing below approximately height/2 shows in the inside of the sphere.
REQUIRES VERIFICATION OF CERTIFICATE BECAUSE IT HAS QUICKTIME VIDEO!? Does anyone know if the GSStreamer Libraries require signed/self-signed certificate? (I may repost this as a separate question if I can't find the answer).
REQUIRES FAST (EG >3.5MHZPROC 6GB MEM GTX285 VIDEO) COMPUTER DUE TO LACK OF CODE REFACTORING TO BASE SKETCH ACTION ON MILLISECOND CYCLES INSTEAD OF CPU DRAW CYCLES. [Required by 4/20/11]
[SOME ACCREDITATION OF SOURCES] Processing.org minim examples. Typography & library examples. I copied the picture of the yellow and black spaceship from when it was posted on Dark Roasted Blend and take no credit for the Yellow Spaceship. Space backgrounds from KDE Kstars, Google Earth/Sky/Planets, and some public domain Hubble Telescope imagery. Unknown artists rendering of a myosquid copied from online science journal aprox. 6/2010. The Woman in Black is Creative Commons' licensed as per google image search "monster women" advanced line art.
The following sketch is supposed to load a series of new traffic camera images (they are updated approximately every five minutes) and then display each image for 4 seconds one at a time with a caption. For some reason, it's displaying the first image without a caption, and then displays the last image with a caption, and doesn't loop through or cycle through the images. Help would be appreciated. I think the problem is with lines 37 through 56 of the TrafficCams class.
Main Sketch (just calls the class with some setup variables, xpos,ypos,width,height,color,alpha,displaytime):
TrafficCams myTrafficCams;
void setup() {
size(400,400);
smooth();
background(0);
myTrafficCams = new TrafficCams(50,100,170,125,255,255,4); //
}
void draw() {
myTrafficCams.DrawTrafficCams();
}
TrafficCams Class
public class TrafficCams {
int x,y,wx,hy;
color c_back;
int trafficalpha;
int cyclerate;
PImage ImageSource; // not used
PImage[] LoadedCams;
PImage NoImage;
String URL;
String[] cams = new String[4];
String Caption;
int UpdateInterval;
int LastUpdate;
public TrafficCams (int xtop, int ytop, int w_x, int h_y, color color_c, int t_alpha, int c_rate) {
x = xtop;
y = ytop;
wx = w_x;
hy = h_y;
c_back = color_c;
cyclerate = c_rate * 1000;
trafficalpha = t_alpha;
NoImage = loadImage("socket_1.png");
LoadedCams = new PImage[cams.length];
cams[0] = "http://www.dot.ca.gov/dist1/d1tmc/hwypix/h101p89.jpg#101 North of Route 299, South";
cams[1] = "http://www.dot.ca.gov/dist1/d1tmc/hwypix/h101p89n.jpg#101 North of Route 299, North";
cams[2] = "http://www.dot.ca.gov/dist1/d1tmc/hwypix/h101p80n.jpg#101 at R Street, Eureka, North";
cams[3] = "http://www.dot.ca.gov/dist1/d1tmc/hwypix/h101p80s.jpg#101 at R Street, Eureka, South";
GetTrafficCams();
delay(1000);
UpdateInterval = 5*60*1000; // update every five minutes
Assuming x and y are initialized as x = width, y = height/2, the following code should draw a series of circles in an ellipse, or part of an ellipse. However, I think there is something wrong with how I am expressing the equation in processing language because y always equals 0. Line 2 is the questionable code formula for an ellipse where you know the height and width (in this case the window dimensions) and the x value.
for (int i = 0; i <= width/2;i++)
{
x = x - i;
y = (-height/width) * sqrt(sq(width) - sq(x));
ellipse(x,y,14,14);
println(str(y));
}
Simple math here folks. I know if you read this far you probably know the answer so give it up, plz.
By defaults, tabs apply to the whole window; when you add tabs they appear starting in the top left corner of the screen and each tab is positioned horizontally across the top of the screen. They are always visible unless you programatically hide them. Tabs are designed to work with separate control windows.
ControllerGroups are controls that can be opened and close, and draw in the main drawing window. They have a bar you can click on the make the controls set to the controller group be visible or hidden depending upon whether the controllgroup is open or closed. I think they are designed to be used with controls appearing in the main drawing window.
And, there are also ControlCanvas and ControlGroupCanvases that can apparently be added to either tabs or ControllerGroups, which are different things. I want to make my controlgroup take up half the width it presently does, and, in order to do that, I need to add the new controls I need to include onto some new control space that draws over and hides the controls presently appearing in the controlgroup.
/**
* Sketch for testing controlP5 Buttons.
*
* UNBSD 2010 (BSD Licensed, fair use)
*/
import controlP5.*;
ControlP5 controlP5;
ColorPicker cp;
Toggle scroll; // Toggle is depreciated; alternate?
Toggle showdescback;// Toggle is depreciated; alternate?
Toggle showtitleback;// Toggle is depreciated; alternate?
void setup() {
size(600,200);
// add controlP5 to the sketch. mandatory.
controlP5 = new ControlP5(this);
// These controls are unassigned to groups and appear all the time
ControlP5's ColorPicker has four sliders, three for red, green, and blue, and the fourth is for alpha. The function getColorValue() returns values in the format: -1 = 255 r,g,b,a; 1684300900 where r,g,b, & a are 100; 0 where all values are zero. I just want to get the alpha value in a form I can use in processing. Alternatively, I could control the alpha with a normal controlP5 slider if there's some way to just show the three color selector bars and not the alpha selector bar.
My second question is that by default -- e.g. controlP5.addToggle("scrolling",true,10,20,10,10).setGroup(l); -- labels appear below checkboxes, as in:
[ ] scrolling
I'd like to put the label above the checkbox, as in:
scrolling [ ]
Ideally, I would like to refer to the value 'scrolling' but, want to display the text, "Scroll Title Text" instead of 'scrolling'.
Do I need to hide the checkbox label and draw a text label, or is there a better way to do this by modifying the checkbox control or using extended styles?
I generally like the default courier(ish) font used by the processing gui, but, I've lost a little productivity being unable to visually distinguish between the numeral 1 and lowercase l (they look the same). Is there a way to change the default font used by the processing gui?
I need a color picker attached to a controlgroup that has a bang toggle in it to control what colors are changed by the colorpicker ... i need to be able to hide and show the control group with bang and colorpicker. Everything works as intended in the code below, but when I include line 15 in my code to, I get a compile error, The method setGroup(ControllerGroup) in the type ControllerGroup is not applicable for the arguments (int).