OBJLoader - NullPointerException confusion
in
Contributed Library Questions
•
2 years ago
So I've got a 3D model, I put it into my data folder and copied an example from the OBJLoader website and integrated it into my Processing sketch. However I keep getting a constant stream of NullPointerException errors when I try to call the draw method on my model object. Why?
OBJModel model;
setup() {
// Load the 3D model
model = new OBJModel(this, "Old_Key.obj");
model.enableDebug();
model.translateToCenter();
}
void loop() {
model.draw();
}
And here is the error that I keep getting every frame:
java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:334)
at saito.objloader.OBJModel.drawModel(OBJModel.java:506)
at saito.objloader.OBJModel.draw(OBJModel.java:485)
at Chronos_Interface.draw(Chronos_Interface.java:218)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
What am I doing wrong?
1