We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › objimport library issue in example file
Page Index Toggle Pages: 1
objimport library issue in example file (Read 2017 times)
objimport library issue in example file
Oct 25th, 2009, 3:44pm
 
I just started playing with the objimport library. When trying to run the simple example I get several errors and the obj file does not get drawn in the sketch window:


java.lang.ClassCastException: java.awt.image.DataBufferInt

Error on line:      map_Kd SP_LUK.JPG
Error, could not load obj:/Users/dpcook/Desktop/Processing/libraries/objimport/examples/loadobj/data/s
ponza.obj

Is this a problem between processing and the java installed on my Mac or is it some arcane file reading problem?
Re: objimport library issue in example file
Reply #1 - Jan 18th, 2010, 5:13pm
 
Hi Daniel,
I've just got a notice about this thread.
I will look into this problem and post a solution asap
Re: objimport library issue in example file
Reply #2 - Feb 15th, 2010, 1:33pm
 
OBJImport has been tested with Snow Leopard and the new compilation.
I was told it runs fine. anyone else having problems

http://victamin.googlecode.com/files/objimport_1_1_1.zip
Re: objimport library issue in example file
Reply #3 - Mar 20th, 2010, 4:10am
 
Hello Victor,

objimport library is awesome! thanks for your work:)
but, I met a similar error message like the one Daniel met.
Here is the my error message (occurred by example sketch "loadobj"):

java.lang.ClassCastException: java.awt.image.DataBufferInt
     at com.obj.TextureLoader.loadTexture(TextureLoader.java:96)
     at com.obj.TextureLoader.loadTexture(TextureLoader.java:52)
     at com.obj.parser.mtl.KdMapParser.parse(KdMapParser.java:37)
     at com.obj.parser.mtl.MaterialFileParser.parse(MaterialFileParser.java:62)
     at com.obj.WavefrontObject.parseLine(WavefrontObject.java:178)
     at com.obj.WavefrontObject.parse(WavefrontObject.java:148)
     at com.obj.WavefrontObject.<init>(WavefrontObject.java:88)
     at com.obj.WavefrontObject.<init>(WavefrontObject.java:54)
     at objimp.ObjImpScene.load(ObjImpScene.java:84)
     at objimp.ObjImpScene.load(ObjImpScene.java:78)
     at loadobj.setup(loadobj.java:51)
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:613)
java.lang.RuntimeException: Error parsing :'/Applications/Processing.app/Contents/Resources/Java/examples/objimport_exampl
es/loadobj/data/sponza.mtl'

Error on line:      map_Kd SP_LUK.JPG
     at com.obj.parser.mtl.MaterialFileParser.parse(MaterialFileParser.java:72)
     at com.obj.WavefrontObject.parseLine(WavefrontObject.java:178)
     at com.obj.WavefrontObject.parse(WavefrontObject.java:148)
     at com.obj.WavefrontObject.<init>(WavefrontObject.java:88)
     at com.obj.WavefrontObject.<init>(WavefrontObject.java:54)
     at objimp.ObjImpScene.load(ObjImpScene.java:84)
     at objimp.ObjImpScene.load(ObjImpScene.java:78)
     at loadobj.setup(loadobj.java:51)

Error, could not load obj:/Applications/Processing.app/Contents/Resources/Java/examples/objimport_exam
ples/loadobj/data/sponza.obj
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:613)


My environment are:
- Mac OSX 10.5.8 (Leopard)
- Processing 1.0.9
- objimport library version 1.1.1

when I open the "sponza.obj" file in text editor and disable its' mtl file, and then run the sketch again. The sketch can be run perfectly without texture material.

but i don't know why it does not work with material file >_<

is there any information or hacked way I can do?
any help is very appreciated!!

thank you very much!
Page Index Toggle Pages: 1