Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all 2896 articles
Browse latest View live

HE_Mesh Examples not working

$
0
0

Hi,

i downloaded the current hemesh library from http://www.wblut.com/he_mesh/ and some of the examples work. But most of the times it says the functions don´t exist.

For example: HE_FaceIterator() doesn´t exist, from Tut006_Mesh_Selection. WB_RBSpline doesn´t exist from spielerei/NurbsGrid. Not one of the color demos in /core works. and so on...

Am i missing a library?? am i using a correct version? I read in another discussion that a lot of methods have changed. i´m using processing 3.2.1 on win 7. I tried the stable build and the daily build.

thanks


Rendered PDF Black , Using with HYPE

$
0
0

I am trying to render the given sketch into a PDF. Everything Works but when I Export it the PDF is full Black.

Here is the Code

/*
    * Author :: Aswin Mohan
    * Twitter :: @aswinmohanme
    *
    * Render an Image of Marlin Monroe with Cirlces , Just Learning
*/

import processing.pdf.*;

import hype.*;
import hype.extended.colorist.*;

HEllipse e;
HImage img;
HPixelColorist colors;

void setup() {
    size(500 , 600);
    H.init(this)
        .background(#000000)
    ;

    // Record PDF
    beginRecord(PDF,"marlin.pdf");

    // Load the Image and the Colors
    img = new HImage("Marlin.gif");
    colors = new HPixelColorist(img);

    int radius = 10;
    int padding = 10;
    int numberShapesX = width / ((radius+padding));
    int numberShapesY = height / ((radius+padding));

    for (int i=0; i < numberShapesX; ++i){
        for (int j=0; j < numberShapesY; ++j) {
            e = new HEllipse();
            e.strokeWeight(0)
                .loc(i*(radius+padding)+radius ,j*(radius+padding) + radius)
                .size(radius)
                .anchorAt(H.CENTER)
            ;
            colors.applyColor(e);
            H.add(e);
        }
    }

}

void draw() {
    H.drawStage();
}

void keyPressed() {
    if (key == 's'){
        endRecord();
        exit();
    }
}

I'm able to get the Output as PNG using saveFrame() but when I export to PDF , the file gets created but the the Contents are Black.

When I run with noLoop(); before the beginRecording(); , and press 's' , the Following Error Message gets shown.

    java.lang.RuntimeException: missing a pushMatrix() to go with that popMatrix()
        at processing.awt.PGraphicsJava2D.popMatrix(PGraphicsJava2D.java:2147)
        at processing.pdf.PGraphicsPDF.endDraw(Unknown Source)
        at processing.core.PApplet.endRecord(PApplet.java:10580)
        at MarlinMonroe_Circles.keyPressed(MarlinMonroe_Circles.java:78)
        at processing.core.PApplet.keyPressed(PApplet.java:3071)
        at processing.core.PApplet.handleKeyEvent(PApplet.java:2947)
        at processing.core.PApplet.dequeueEvents(PApplet.java:2621)
        at processing.core.PApplet.postEvent(PApplet.java:2607)
        at processing.awt.PSurfaceAWT.nativeKeyEvent(PSurfaceAWT.java:1346)
        at processing.awt.PSurfaceAWT$10.keyPressed(PSurfaceAWT.java:1399)
        at java.awt.Component.processKeyEvent(Component.java:6491)
        at java.awt.Component.processEvent(Component.java:6310)
        at java.awt.Component.dispatchEventImpl(Component.java:4889)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
        at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
        at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
        at java.awt.Component.dispatchEventImpl(Component.java:4760)
        at java.awt.Container.dispatchEventImpl(Container.java:2294)
        at java.awt.Window.dispatchEventImpl(Window.java:2746)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.awt.EventQueue$4.run(EventQueue.java:729)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Finished.

How do I fix this.

How to add another variable to this code

$
0
0

song=song == song2? song1:song2; i am trying to add song3 at the end so it will alternate between 3 songs

How do I load gifs?

$
0
0

I loaded a gif but all I see is a blurry picture

gif = loadImage("gif.gif"); image(gif,width/2,height/2)

Game Control Plus - recognizing a device?

$
0
0

I'm trying to get GCP to work again with a sketch I'm redirecting but struggling to get the library to find any devices on my system. Installed 1.2 library. I run GCP_showDevices and get no results, though there is both keyboard and trackball attached. I presume the library can't get signals from the peripherals if show devices isn't finding them and this is my problem. my sketch did have the layout file for the library to reference from the old sketch, but no matter what I can't seem to locate the trackpad. I must be doing something wrong as it seems that other people have used this recently

I seem to remember this being painful before. I've removed all usb hubs that I can, so not going thru one except in the computer. I seem to recall issues when more than one controller attached too. Tried rebooting....

Not sure where to look next. Perhaps trying to use the actual java libraries?

DisconnectException

$
0
0

Hey, I recently tried to create a server with processing and I want to return, if the client enters an unvalid IP+Port with the help of a try catch. Unfortunately it isn't working, also if I import java.net.ConnectException.

Cannot find anything Named "surface"

$
0
0

public void start_click(GButton source, GEvent event) { //CODE:start:285860: //println("start - GButton >> GEvent." + event + " @ " + millis()); start.setVisible(false); startPlot = true; start.setLocalColorScheme(GCScheme.CYAN_SCHEME); record.setEnabled(true); done.setEnabled(true); label1.setVisible(true); label2.setVisible(true); record.setLocalColorScheme(GCScheme.GREEN_SCHEME); } //CODE:start:285860:

public void portList_click(GDropList source, GEvent event) { //CODE:portList:554725: //println("portList - GDropList >> GEvent." + event + " @ " + millis()); selectedPort = portList.getSelectedText(); portSelected = true; portList.setEnabled(false); portList.setLocalColorScheme(GCScheme.CYAN_SCHEME);

} //CODE:portList:554725:

public void record_click(GButton source, GEvent event) { //CODE:record:865284: //println("record - GButton >> GEvent." + event + " @ " + millis()); //////////////////////////////////////////////////////////////////////////////// // // Enable the buttons and calls the serial port function // Comselect is made true to call the serial function //
/////////////////////////////////////////////////////////////////////////////// try { jFileChooser = new JFileChooser(); jFileChooser.setSelectedFile(new File("log.txt")); jFileChooser.showSaveDialog(null); String filePath = jFileChooser.getSelectedFile()+"";

if ((filePath.equals("log.txt"))||(filePath.equals("null")))
{
} else
{
  done.setVisible(true);
  record.setVisible(false);

  start.setEnabled(false);
  close.setEnabled(false);
  start.setLocalColorScheme(GCScheme.CYAN_SCHEME);
  close.setLocalColorScheme(GCScheme.CYAN_SCHEME);

  logging = true;
  date = new Date();
  output = new FileWriter(jFileChooser.getSelectedFile(), true);
  bufferedWriter = new BufferedWriter(output);
  bufferedWriter.newLine();
  bufferedWriter.write(date+"");
  bufferedWriter.newLine();
  bufferedWriter.newLine();
  bufferedWriter.flush();
  bufferedWriter.close();
}

} catch(Exception e) { println("File Not Found"); } } //CODE:record:865284:

public void done_click(GButton source, GEvent event) { //CODE:done:510429: //println("done - GButton >> GEvent." + event + " @ " + millis()); //////////////////////////////////////////////////////////////////////////////// // // Save the file and displays a success message //
/////////////////////////////////////////////////////////////////////////////// if (logging == true) { showMessageDialog(null, "Log File Saved successfully");

record.setVisible(true);
done.setVisible(false);

close.setEnabled(true);
close.setLocalColorScheme(GCScheme.GREEN_SCHEME);
record.setEnabled(true);
record.setLocalColorScheme(GCScheme.GREEN_SCHEME);
done.setEnabled(true);
done.setLocalColorScheme(GCScheme.GREEN_SCHEME);
logging = false;

} } //CODE:done:510429:

public void close_click(GButton source, GEvent event) { //CODE:close:309405: //println("close - GButton >> GEvent." + event + " @ " + millis()); exit(); } //CODE:close:309405:

public void imgButton1_click1(GImageButton source, GEvent event) { //CODE:imgButton1:430047: println("imgButton1 - GImageButton >> GEvent." + event + " @ " + millis()); } //CODE:imgButton1:430047:

// Create all the GUI controls. // autogenerated do not edit public void createGUI(){ G4P.messagesEnabled(false); G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME); G4P.setCursor(ARROW); surface.setTitle("Sketch Window"); /////////error here start = new GButton(this, 260, 7, 100, 35); start.setText("START"); start.setTextBold(); start.setLocalColorScheme(GCScheme.GREEN_SCHEME); start.addEventHandler(this, "start_click"); portList = new GDropList(this, 5, 7, 200, 396, 10); portList.setItems(loadStrings("list_554725"), 0); portList.setLocalColorScheme(GCScheme.GREEN_SCHEME); portList.addEventHandler(this, "portList_click"); record = new GButton(this, 395, 7, 100, 35); record.setText("RECORD"); record.setTextBold(); record.setLocalColorScheme(GCScheme.GREEN_SCHEME); record.addEventHandler(this, "record_click"); done = new GButton(this, 395, 7, 100, 35); done.setText("DONE"); done.setTextBold(); done.setLocalColorScheme(GCScheme.GREEN_SCHEME); done.addEventHandler(this, "done_click"); close = new GButton(this, 527, 7, 100, 35); close.setText("CLOSE"); close.setTextBold(); close.setLocalColorScheme(GCScheme.GREEN_SCHEME); close.addEventHandler(this, "close_click"); imgButton1 = new GImageButton(this, 897, 564, 100, 30, new String[] { "logo.png", "logo.png", "logo.png" } ); imgButton1.addEventHandler(this, "imgButton1_click1"); bpm1 = new GLabel(this, 558, 75, 240, 95); bpm1.setTextAlign(GAlign.CENTER, GAlign.MIDDLE); bpm1.setOpaque(false); label1 = new GLabel(this, 460, 290, 80, 20); label1.setTextAlign(GAlign.CENTER, GAlign.MIDDLE); label1.setText("My label"); label1.setOpaque(false); label2 = new GLabel(this, 460, 290, 80, 20); label2.setTextAlign(GAlign.CENTER, GAlign.MIDDLE); label2.setText("My label"); label2.setOpaque(false); }

// Variable declarations // autogenerated do not edit GButton start; GDropList portList; GButton record; GButton done; GButton close; GImageButton imgButton1; GLabel bpm1; GLabel label1; GLabel label2;

How to convert mesh from ComputationalGeometry Lib to ToxicLibs?

$
0
0

Hey there,

I am a beginner user of Proccessing. I made some meshes with ComputationalGeometry (http://www.thecloudlab.org/processing/library.html) and now I want to transfer it to ToxicLibs mesh. ToxicLibs has more meshprocesing options (stl export, laplacian smoothing etc.). Any suggestions?


Image generator, how to add tags?

$
0
0

Hi guys,

This is my image generator with png's. There will be 3 different "tags", my question is how can I have tags in my code for people to chose with images are going to be combined?

PImage[] myImageArray = new PImage[5];
PImage[] myImageArray2 = new PImage[5];
//PImage[] myImageArray3 = new PImage[5];

void setup() {
  size(100, 100);
  background(255);


  for (int i=0; i<myImageArray.length; i++) {

    myImageArray[i] = loadImage  ( "b" + i + ".png");
    myImageArray2[i] = loadImage  ( "a" + i + ".png");

    // myImageArray3[i] = loadImage( "c" + i + ".png");
  }
  display();
}
void display() {

  int b = (int)random(4);
  image(myImageArray[(int)random(myImageArray.length)], 0, 0, 100, 100);
  int a = (int)random(4);
  image(myImageArray2[(int)random(myImageArray.length)], random (15), random (15), 100, 100);
  // int c = (int)random(10);
}
void draw() {
}
void mousePressed() {
  display();
  background (255);
  display();
}

Capture movie frames playing on attached screen in realtime?

$
0
0

Hello All,

I'm new to this, and am looking for some guidance.

I'm working with someone else's code (they know that I am) and I'm trying to modify it for testing and not bother them. Currently, we're capturing movie playback via external webcam and passing the data it collectors to Super Collider. It works, but is a bit cumbersome to set up a webcam and point it at the attached screen. What I'm looking to do is eliminate the external camera and just capture the frames from the attached screen in realtime. Any advice or directions you can point me in?

Indoor Navigation

$
0
0

Hello.

I asked a similar question to this a few days ago, please see: https://forum.processing.org/two/discussion/20564/indoor-navigation-using-rfid-technology#latest - but the spec of my application has now changed.

I am new to Processing and a beginner when it comes to programming in general so apologies for my lack of correct vocabulary when it comes to explaining things.

I am trying to create an application which gives the user a top-down view of a hospital building plan and allows them to choose, from a drop down menu, where they would like to go within the hospital. Each location has predefined co-ordinates and when the user chooses that location, a line will be draw from their current location to the location they have chosen. Obviously the line that is draw cannot be straight from point to point, as that would mean the line would be cutting through 'rooms' and 'walls' etc. The lines would have to follow the 'corridors' of the hospital.

Is this possible in Processing or should I be considering different Android development programs?

Any help/tutorials to set me on my way with the code will be much appreciated.

3D Render in Processing 3

$
0
0

Hi, I got changed my GUI in Processing3. Now I have issues with the 3d Render. I get this error message:

translate(), or this particular variation of it, is not available with this renderer. rotateX() can only be used with a renderer that supports 3D, such as P3D.

I tested with P3D and PDF. For controls i use Java AWT.

    @ Override
    public void settings() {
      size(1300, 700);      P3D or PDF
    }

    @ Override
    public void setup(){

        menu_setup();
    }

    void menu_setup(){
     mainFrame = new Frame();
     menuListen = new myMenuListener();
     myMenu = new MenuBar();
     mainFrame.setMenuBar(myMenu);
     mainFrame.setVisible(true);
    }

can anybody help me?

Regards Willi

Combining to frames

$
0
0

hello again , can anyone of you help me with this.

i made 2 frames and want to make them in one but the issue is whenever i want to do that my button always get lost and not able to see it but when i close/comment map.draw(); function . i can see button but then my map is not loading. here are my 2 codes.

1 code :

    import de.fhpotsdam.unfolding.providers.Microsoft;
    import de.fhpotsdam.unfolding.*;
    import de.fhpotsdam.unfolding.utils.*;
    import de.fhpotsdam.unfolding.marker.*;
    import de.fhpotsdam.unfolding.geo.*;



    UnfoldingMap map ;
    UnfoldingMap currentMap;
    SimpleLinesMarker connectionMarker;


    void settings() {

      // size(400,400);

      size(800,600,P3D);

      map = new UnfoldingMap(this, new Microsoft.AerialProvider());
      MapUtils.createDefaultEventDispatcher(this, map);
      currentMap = map;

      map = new UnfoldingMap(this,0,0,width*0.8,height);
      Location startLocation = new Location(32.2, 76.3);
      Location endLocation = new Location(53.35, -6.26);
      SimpleLinesMarker connectionMarker = new SimpleLinesMarker(startLocation, endLocation);
      MapUtils.createDefaultEventDispatcher(this, map);

    }


    void draw() {
      background(0);
      currentMap.draw();

    }

    void mousePressed() {
      exit();
    }


and My 2nd Code ;

import controlP5.*;

ControlFrame cf;
ControlP5 cp5;



void setup(){
  cf = new ControlFrame(this, 400, 400, "Controls");
  surface.setLocation(430,10);
  noStroke();


}


class ControlFrame extends PApplet {

  int w, h;
  PApplet parent;
  ControlP5 cp5;

  public ControlFrame(PApplet _parent, int _w, int _h, String _name) {
    super();
    parent = _parent;
    w=_w;
    h=_h;
    PApplet.runSketch(new String[]{this.getClass().getName()}, this);
  }

  public void settings() {
    size(w,h);
  }

  public void setup() {
    surface.setLocation(10,10);
    cp5 = new ControlP5(this);

  cp5.addTab("extra")
     .setColorBackground(color(0, 160, 100))
     .setColorLabel(color(255))
     .setColorActive(color(255,128,0))
     ;

  // if you want to receive a controlEvent when
  // a  tab is clicked, use activeEvent(true)

  cp5.getTab("default")
     .activateEvent(true)
     .setLabel("my default tab")
     .setId(1)
     ;

  cp5.getTab("extra")
     .activateEvent(true)
     .setId(2)
     ;


  // create a few controllers

  cp5.addButton("button")
     .setBroadcast(false)
     .setPosition(20,20)
     .setSize(80,40)
     .setValue(1)
     .setBroadcast(true)
     .getCaptionLabel().align(CENTER,CENTER)
     ;

  cp5.addButton("buttonValue")
     .setBroadcast(false)
     .setPosition(110,20)
     .setSize(80,40)
     .setValue(2)
     .setBroadcast(true)
     .getCaptionLabel().align(CENTER,CENTER)
     ;
  //  cp5.addNumberbox("seed").plugTo(parent, "seed").setRange(0, 360).setValue(1).setPosition(100, 10).setSize(100,20);

  }

  void draw() {
    background(40);
  }
}

Sharing values

$
0
0

I want a code which puts a certain value of the program to a whole other system or a website. I do not expect an explanation, but I was hoping someone could give me a place to start, if this is even possible

UTC/GMT time using UDP

$
0
0

Extracting data from ntp servers is very easy using an ESP8266 and/or Arduino ethernet or wifi. Since I absolutely love Processing for it's awesome libraries, flexibility, and easy to use IDE I decided to give it a spin using the following as a reference: https://www.arduino.cc/en/Tutorial/UdpNtpClient. Since Processing's support for the 'long' data type is mostly useless parsing up the received packet got pretty messy. The program is doing exactly what I want but before going any further I'd like to know if there is any better way to parse up the received packet. Thank you for looking.

// import UDP library
import hypermedia.net.*;

UDP udp;  // define the UDP object

byte packetBuff[] = new byte[48];

void setup()
{
  size(175, 100);
  // create a new datagram connection on port 8888
  // and wait for an incoming message
  udp = new UDP( this, 8888 );
  udp.listen( true );

  for (int i = 0; i < 48; i += 1) packetBuff[i] = 0; // fill packetBuff with 0's

  packetBuff[0]   = byte(227);   // LI, Version, Mode
  packetBuff[1]   = 0;           // Stratum, or type of clock
  packetBuff[2]   = 6;           // Polling Interval
  packetBuff[3]   = byte(236);   // Peer Clock Precision
  // 8 bytes of zero for Root Delay & Root Dispersion
  packetBuff[12]  = 49;
  packetBuff[13]  = 78;
  packetBuff[14]  = 49;
  packetBuff[15]  = 52;
  // all NTP fields have been given values, now
  // you can send a packet requesting a timestamp:
}

//process events
void draw() {
}


void mouseClicked()
{
  String ip   = "time.nist.gov";      // the destination IP
  //String ip     = "us.pool.ntp.org";    // the destination IP
  int port      = 123;                  // the destination port
  // send the buffer
  udp.send(packetBuff, ip, port );
  background(random(256), random(256), random(256));
}


void receive( byte[] data )  // <-- default handler
{

  for (int i = 0; i < 48; i += 1)
  {
    int k = data[i] & 0xFF;
    if (i >= 40 && i < 44) println("data[" + i + "]" + " = " + k);
  }

  int ab = data[40] & 0xFF; // data[40 to 43] hi byte to low byte
  int ac = data[41] & 0xFF; // is seconds since January 1 1900 (UNIX time)
  int ad = data[42] & 0xFF;
  int ae = data[43] & 0xFF;

  int af = ((ab << 24)+(ac << 16)+(ad << 8)+(ae));
  af -= 1104494400; // subtract 2208988800 seconds for 70 years in two chunks
  af -= 1104494400; // af = signed number that represents seconds since January 1 1970

  // convert to UTC/GMT time
  int ag = Integer.remainderUnsigned(af, 86400); // get modulus using seconds in 24 hours
  ag /= 3600; // extract hours
  String ah = Integer.toUnsignedString(af); // thank you Java 8 Integer class :)
  println("Seconds since January 1 1970 = " + ah);

  print("UTC/GMT time = " + ag + ":"); // hours

  // In the first 10 minutes of each hour print a leading '0'
  if (((af % 3600) / 60) < 10)  print('0');

  //print the minute (3600 equals secs per minute)
  println((af  % 3600) / 60);
  println();
}

Making random words bold in a string?

$
0
0

Hi all. So right now, this code generates a paragraph of random sentences taken from the dataset.rtf file by using the rita library. Is there a way to assign random words to print out as bold or a different color? So, for example.. example text A would be example text B instead:

Text A: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor.

Text B: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor.

Thanks!!

import rita.*;

RiMarkov markov; String line = "click to (re)generate!"; String[] files = { "dataset.rtf" }; int x = 160, y = 240;

void setup() { size(500, 500);

fill(0); textFont(createFont("times", 16));

// create a markov model w' n=3 from the files markov = new RiMarkov(6); markov.loadFrom(files, this); }

void draw() { background(250); text(line, x, y, 400, 400); }

void mouseClicked() { if (!markov.ready()) return;

x = y = 50; String[] lines = markov.generateSentences(2); line = RiTa.join(lines, " "); }

Problem with "Sound" library

$
0
0

I'm trying to run the example in the documentation for the "Sound" library (https://processing.org/reference/libraries/sound/SoundFile.html) but I'm getting an error. I'm running v1.3.2 of the library, under Processing 3.1.1 and Windows 7 Pro. I tried both the 32-bit and 64-bit versions of Processing. The only change I made to the code was to change line 9 to point to the mp3 file on my hard drive. But when I try to open the file, I get this error message:

The constructor "SoundFile(SoundFile, String)" does not exist.

The error message doesn't make any sense, at least to me. I'm passing "this" as the first parameter, just as in the example, and a string with the full path name of the mp3 file as the second parameter. Why does it think "this" is a SoundFile?

Is the "Sound" library still working?

Here's my code, although as I said, I only changed the one line which opens the file.

import processing.sound.*;
SoundFile file;

void setup() {
  size(640, 360);
  background(255);

  // Load a soundfile from the /data folder of the sketch and play it back
  file = new SoundFile(this,"C:\\Users\\owner\\Music\\% Attac\\01 Tonino Carotone & Manu Chao - La Trampa.mp3");
  file.play();
}

void draw() {
}

hi everyone. guys helpme. i want to scan from 100 to 380 of my video.height

$
0
0

import processing.video.*; Capture video;

void setup() { size(640, 480); // Uses the default video input, see the reference if this causes an error video = new Capture(this, width, height); video.start();
noStroke(); smooth(); }

void draw() { if (video.available()) { video.read(); image(video, 0, 0, width, height); // Draw the webcam video onto the screen int brightestX = 0; // X-coordinate of the brightest video pixel int brightestY = 0; // Y-coordinate of the brightest video pixel float brightestValue = 0; // Brightness of the brightest video pixel // Search for the brightest pixel: For each row of pixels in the video image and // for each pixel in the yth row, compute each pixel's index in the video video.loadPixels(); int index = 0; for (int y =0 ; y < video.height; y++) { for (int x = 0; x < video.width; x++) { // Get the color stored in the pixel int pixelValue = video.pixels[index]; // Determine the brightness of the pixel float pixelBrightness = brightness(pixelValue); // If that value is brighter than any previous, then store the // brightness of that pixel, as well as its (x,y) location if (pixelBrightness > brightestValue) { brightestValue = pixelBrightness; brightestY = y; brightestX = x; pixelBrightness = color(256); } index++; } } // Draw a large, yellow circle at the brightest pixel fill(255, 204, 0, 128); ellipse(brightestX, brightestY, 50, 50); text("brightestX: " + brightestX, 20,20); text("brightestY: " + brightestY, 20,40); text("brightnesslevel: " + brightestValue, 20, 60); } }

HE_mesh Wireframe Modifier Problem

$
0
0

Hi, could somebody please help me??

when i use the wireframe modifier the mesh gets messed up and torn. It doesn´t even work in the example files or tutorials.

I´m using 3.2.1

Thank you

Where is the HE_Mesh documentation?

$
0
0

Hello, a super simple question but I can't find the answer... where is the documentation for the HEMesh library? A part from the tutorials, I could only find this, where there is not very much... thank you for your help.

Viewing all 2896 articles
Browse latest View live