201708-02 lights()设置默认光源参数 Name lights()设置默认光源参数 Examples size(100, 100, P3D); background(0); noStroke(); // Sets the default ambient //.... Read More >
201708-02 lightFalloff()光源衰减率 Name lightFalloff()光源衰减率 Examples size(100, 100, P3D); noStroke(); background(0); lightFalloff(1.0, 0.001, 0.0);.... Read More >
201708-02 directionalLight()定向光源 Name directionalLight()定向光源 Examples size(100, 100, P3D); background(0); noStroke(); directionalLight.... Read More >
201708-02 ambientLight()环境光源 NameambientLight()环境光源 Examples size(100, 100, P3D); background(0); noStroke(); // The spheres are white by default so // the ambient light ch.... Read More >
201708-02 selectOutput()选择输出 NameselectOutput()选择输出 Examplesvoid setup() { selectOutput("Select a file to write to:", "fileSelected"); } void fileSelected(File selection) { if (selection == null) { println("Window was .... Read More >
201708-02 saveXML()保存XML对象 NamesaveXML()保存XML对象 Examples// The following short XML file called "mammals.xml" is parsed // in the code below. It must be in the project's "data" folder. // // <?xml version="1.0"?> // <.... Read More >
201708-02 saveTable()保存表 NamesaveTable()保存表 ExamplesTable table; void setup() { table = new Table(); table.addColumn("id"); table.addColumn("species"); table.addColumn("name"); TableRow newRow = table.a.... Read More >
201708-02 saveStrings()保存字符串 NamesaveStrings()保存字符串 ExamplesString words = "apple bear cat dog"; String[] list = split(words, ' '); // Writes the strings to a file, each on a separate line saveStrings("nouns.txt", list);Descri.... Read More >
201708-02 saveStream()保存流文件 NamesaveStream()保存流文件 Examples DescriptionSave the contents of a stream to a file in the sketch folder. This is basically saveBytes(blah, loadBytes()), but done more efficiently (and with less confus.... Read More >
201708-02 saveJSONObject()保存JSON对象 NamesaveJSONObject()保存JSON对象 ExamplesJSONObject json; void setup() { json = new JSONObject(); json.setInt("id", 0); json.setString("species", "Panthera leo"); json.setString("name", "Li.... Read More >
201708-02 saveJSONArray()保存JSON数组 NamesaveJSONArray()保存JSON数组 ExamplesString[] species = { "Capra hircus", "Panthera pardus", "Equus zebra" }; String[] names = { "Goat", "Leopard", "Zebra" }; JSONArray values; void setup() { .... Read More >
201708-02 saveBytes()保存byte数组 NamesaveBytes()保存byte数组 Examplesbyte[] nums = { 0, 34, 5, 127, 52}; // Writes the bytes to a file saveBytes("numbers.dat", nums);DescriptionAs the opposite of loadBytes(), this function will write .... Read More >
201708-02 PrintWriter打印文本输出 NamePrintWriter打印文本输出ExamplesPrintWriter output; void setup() { // Create a new file in the sketch directory output = createWriter("positions.txt"); } void draw() { point(mouseX, mouseY); .... Read More >
201708-02 endRecord()结束记录 NameendRecord()结束记录 Examplesimport processing.pdf.*; void setup() { size(400, 400); beginRecord(PDF, "everything.pdf"); } void draw() { ellipse(mouseX, mouseY, 10, 10); } void mousePresse.... Read More >
201708-02 endRaw()结束抓取 NameendRaw()结束抓取 Examplesimport processing.pdf.*; void setup() { size(400, 400); beginRaw(PDF, "raw.pdf"); } void draw() { line(pmouseX, pmouseY, mouseX, mouseY); } void keyPressed() { .... Read More >
201708-02 createWriter()创建文本 NamecreateWriter()创建文本 ExamplesPrintWriter output; void setup() { // Create a new file in the sketch directory output = createWriter("positions.txt"); } void draw() { point(mouseX, mouseY).... Read More >
201708-02 createOutput()创建输出 NamecreateOutput()创建输出 Examples DescriptionSimilar to createInput(), this creates a Java OutputStream for a given filename or path. The file will be created in the sketch folder, or in the same folde.... Read More >
201708-02 beginRecord()开始记录 NamebeginRecord()开始记录 Examplesimport processing.pdf.*; void setup() { size(400, 400); beginRecord(PDF, "everything.pdf"); } void draw() { ellipse(mouseX, mouseY, 10, 10); } void mousePres.... Read More >