201708-05 spotLight()聚光灯 NamespotLight()聚光灯 Examples size(100, 100, P3D); background(0); noStroke(); spotLight(51, 102, 126, 80, 20, 40, -1, 0, 0, PI/2, 2); translate(.... Read More >
201708-05 pointLight()添加点光源 NamepointLight()添加点光源 Examples size(100, 100, P3D); background(0); noStroke(); pointLight(51, 102, 126, 35, 40, 36); translate(80, 50, 0); sph.... Read More >
201708-05 normal()设置当前正常向量 Namenormal()设置当前正常向量 Examples size(100, 100, P3D); noStroke(); background(0); pointLight(150, 250, 150, 10, 30, 50); beginShape(); normal(0, 0.... Read More >
201708-05 noLights()禁用照明 NamenoLights()禁用照明 DescriptionDisable all lighting. Lighting is turned off by default and enabled with the lights() function. This function can be used to disable lighting so that 2D geometry (which .... Read More >
201708-05 lightSpecular()光镜面 NamelightSpecular()光镜面 Examples size(100, 100, P3D); background(0); noStroke(); directionalLight(102, 102, 102, 0, 0, -1); lightSpecular(204, .... Read More >
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 >