Hello,
I’m trying to load and display files via drag and drop into the viewport with the drop library.
It works totally fine using images, but my for my project I have to be able to import 3D models. Processings P3D rendering method does not support drag and dropping into the window.
As you can see here:
Does anyone have an idea for a workaround, which doesn’t require two windows as this example uses.
Here is the code:
import drop.*;
SDrop drop;
PShape m;
void setup() {
size(400,400, P3D);
drop = new SDrop(this);
}
void draw() {
background(0);
translate(width/2, height/2, -200);
if(m !=null) {
shape(m);
}
}
void dropEvent(DropEvent theDropEvent) {
if(theDropEvent.isFile()) {
File myFile = theDropEvent.file();
if(myFile.isFile()) {
println(myFile);
String myFileStr = myFile.toString();
myFileStr = myFileStr.replace("\\", "/");
m = loadShape(myFileStr);
}
}
}