내가 selectinput의 사용과 관련하여이 스레드처리 2 selectInput() P3D 충돌
Processing 2.0 - Open file dialog 을 공부했습니다(). 일부 3D 플롯을 만들기 위해 점 데이터를 가져 오려고합니다. 데이터를 가져오고 플롯을 만들 수 있지만 selectinput()을 사용하여 파일을 선택하려고하면 문제가 발생합니다. 내가 겪고있는 어려움은 selectinput()이 P3D 창과 호환되지 않는 것 같습니다. 예를 들어,이 코드는 OS의 X10.10
사용
는
void setup() {
size(400, 400,P3D); //3Dgraphics specified
background(0);
stroke(255);
frameRate(20);
}
void draw() {
noFill();
ellipse(mouseX, mouseY, 90, 90);
작동 이것은
String [] myInputFileContents ;
String myFilePath;
void setup() {
selectInput("Select a file : ", "fileSelected");
while (myInputFileContents == null) {//wait
// println("wait"); //If there is nothing inside the curly brackets
//delay(3000); //this doesn't work
size(400, 400);/// If P3D is added it won't work
background(0);
//smooth();
stroke(255);
frameRate(25);
}
}
void draw() {
box(mouseX, mouseY, 150);
println("Selected at this point " + myFilePath);
}
void mousePressed() {
selectInput("Select a file : ", "fileSelected");
}
void fileSelected(File selection) {
if (selection == null) {
println("no selection so far...");
}
else {
myFilePath = selection.getAbsolutePath();
myInputFileContents = loadStrings(myFilePath) ;// this moves here...
println("User selected " + myFilePath);
}
}
하지만
size(400, 400);
경우
0 변경된 작품size(400,400,P3D);
프레임은 표시되지만 그릴 수는 없습니다.
누군가 나를 대답 할 수 있습니까?