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 & HelpOther Libraries › Linux prob with objloader
Page Index Toggle Pages: 1
Linux prob with objloader (Read 1350 times)
Linux prob with objloader
Jun 28th, 2007, 10:51am
 
I try to load ( a rather big) .obj via Saitos objloader library. While this works fine using processing0124 on WinXP, I got the following exception with it on Linux:
Has anybody seen this before? What to do?

greetings


java.lang.RuntimeException: Too many calls to popMatrix() (and not enough to pushMatrix)

at processing.core.PGraphics3D.popMatrix(PGraphics3D.java:2632)

at processing.core.PApplet.popMatrix(PApplet.java:7445)

at Temporary_3413_8620.draw(Temporary_3413_8620.java:38 )

at processing.core.PApplet.handleDisplay(PApplet.java:1355)

at processing.core.PGraphics.requestDisplay(PGraphics.java:564)

at processing.core.PApplet.run(PApplet.java:1450)

at java.lang.Thread.run(Thread.java:619)

java.lang.RuntimeException: Too many calls to popMatrix() (and not enough to pushMatrix)

at processing.core.PGraphics3D.popMatrix(PGraphics3D.java:2632)

at processing.core.PApplet.popMatrix(PApplet.java:7445)

at Temporary_3413_8620.draw(Temporary_3413_8620.java:38 )

at processing.core.PApplet.handleDisplay(PApplet.java:1355)

at processing.core.PGraphics.requestDisplay(PGraphics.java:564)

at processing.core.PApplet.run(PApplet.java:1450)

at java.lang.Thread.run(Thread.java:619)
Re: Linux prob with objloader
Reply #1 - Jun 28th, 2007, 12:55pm
 
Hmm. That's a weird one. I don't have a linux setup to try and replicate the error but how about a couple of questions.

- How many objects in the obj file?
- Does the same error happen with a simple obj file (Like a cube)?
- Have you tried OPENGL?
- Have you tried adding a pushMatrix() after the draw of the model (no reason why that should work but just throwing it out there)
Re: Linux prob with objloader
Reply #2 - Jun 28th, 2007, 1:17pm
 
Quote:
- How many objects in the obj file?
- Does the same error happen with a simple obj file (Like a cube)?
- Have you tried OPENGL?
- Have you tried adding a pushMatrix() after the draw of the model (no reason why that should work but just throwing it out there)


I just used to example-code that came with the library, and changed nothing but the model (and copy over the textures and *.mtl to processing root).

I just used the example-code with the the given dma.obj, same prob, same parts display (sometimes), the mouse-drag-events dont work:

V  Size: 727
Vt Size: 916
Vn Size: 1494
G  Size: 6
S Size: 64

java.lang.RuntimeException: Too many calls to popMatrix() (and not enough to pushMatrix)
at processing.core.PGraphics3D.popMatrix(PGraphics3D.java:2632)
at processing.core.PApplet.popMatrix(PApplet.java:7445)
at Temporary_5216_3911.draw(Temporary_5216_3911.java:54)
at processing.core.PApplet.handleDisplay(PApplet.java:1355)
at processing.core.PGraphics.requestDisplay(PGraphics.java:564)
at processing.core.PApplet.run(PApplet.java:1450)
at java.lang.Thread.run(Thread.java:619)
java.lang.RuntimeException: Too many calls to popMatrix() (and not enough to pushMatrix)
at processing.core.PGraphics3D.popMatrix(PGraphics3D.java:2632)
at processing.core.PApplet.popMatrix(PApplet.java:7445)
at Temporary_5216_3911.draw(Temporary_5216_3911.java:54)
at processing.core.PApplet.handleDisplay(PApplet.java:1355)
at processing.core.PGraphics.requestDisplay(PGraphics.java:564)
at processing.core.PApplet.run(PApplet.java:1450)
at java.lang.Thread.run(Thread.java:619)

So I guess S Size somehow counts geometries int the obj, the one I used has:

V  Size: 63689
Vt Size: 74323
Vn Size: 24100
G  Size: 3634
S Size: 8672

With OPENGL you mean a part of the processing-API, to load an obj another way?
Any link?
BTW the model works fine with sketchup, blender and Java3D ...
Re: Linux prob with objloader
Reply #3 - Jun 28th, 2007, 1:39pm
 
the OPENGL idea was just the standard processing use.

Quote:

import processing.opengl.*;

size(400,400,OPENGL);


The S Size is the number of model segments and 8672 is a lot but it shouldn't kill it.

Ok new idea, how about cutting the model down by half (just rough) and see if that works. If it does you could load up two models and draw them both.
Re: Linux prob with objloader
Reply #4 - Jun 28th, 2007, 1:54pm
 
Ok did some more poking through the obj loader and the model draw function doesn't use popMatrix() or pushMatrix() it's just a beginShape and endShape for the number of model segments. So my guess would be some linux weirdness.

So did cutting down the model to smaller models work out?
Re: Linux prob with objloader
Reply #5 - Jun 28th, 2007, 3:03pm
 
polymonkey wrote on Jun 28th, 2007, 1:54pm:
Ok did some more poking through the obj loader and the model draw function doesn't use popMatrix() or pushMatrix() it's just a beginShape and endShape for the number of model segments. So my guess would be some linux weirdness.

So did cutting down the model to smaller models work out

The last trace was just the demo-obj from Saito, which doesnt work. Loading one by one may work, but I guess I have to do all the placement (not funny)... the problem happens somewhere in processing.core...

I just found out, that after immediate startup, SOMETIMES the OBJload-demo works, but doesnt after loading a different one (even a small one like just one box) ... strange ... my obj seems to big anyway Sad
now even the simplebox.obj fails, with another exception:

Obj Name: Cube_Cube

V  Size: 8
Vt Size: 0
Vn Size: 0
G  Size: 1
S Size: 2

java.lang.ArrayIndexOutOfBoundsException

at java.lang.System.arraycopy(Native Method)

at sun.awt.image.ImageRepresentation.setPixels(ImageRepresentation.java:511)
at java.awt.image.MemoryImageSource.sendPixels(MemoryImageSource.java:549)
at java.awt.image.MemoryImageSource.newPixels(MemoryImageSource.java:464)
at java.awt.image.MemoryImageSource.newPixels(MemoryImageSource.java:384)
at java.awt.image.MemoryImageSource.newPixels(MemoryImageSource.java:516)
at processing.core.PGraphics3D.endDraw(PGraphics3D.java:389)
at processing.core.PApplet.handleDisplay(PApplet.java:1398 )
at processing.core.PGraphics.requestDisplay(PGraphics.java:564)
at processing.core.PApplet.run(PApplet.java:1450)
at java.lang.Thread.run(Thread.java:619)
Re: Linux prob with objloader
Reply #6 - Jun 28th, 2007, 4:01pm
 
polymonkey wrote on Jun 28th, 2007, 1:39pm:
the OPENGL idea was just the standard processing use.


funny, but it works this way, thx alot polymonkey Smiley
Re: Linux prob with objloader
Reply #7 - Jun 28th, 2007, 5:41pm
 
lhz wrote on Jun 28th, 2007, 4:01pm:
funny, but it works this way, thx alot polymonkey Smiley

except ... where have all the textures gone
in WINXP also: textures are missing when I change from P3D to OPENGL ...
Re: Linux prob with objloader
Reply #8 - Jun 28th, 2007, 10:37pm
 
Yeah that's the third time I've heard that about texture weirdness. I'm going to try and look into that today. I did post an idea to the end of this thread

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=LibraryProblems;action=display;num=1180289817;start=0#5

but I'll keep you posted if I come up witth anything for the weird texture problem.

MattD
Page Index Toggle Pages: 1