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 & HelpPrograms › P3D RENDER PROBLEM
Page Index Toggle Pages: 1
P3D RENDER PROBLEM (Read 474 times)
P3D RENDER PROBLEM
Jan 17th, 2009, 2:50am
 
Hello I am trying to develop am architectural drawing based upon neighboorhoods.
Since it is a 240 ha site I am deeling with the amount of data it handels is a little big large.

It basicly works fine but from time to time there occurs an error message and the rendering stops but the program still continues. Sometime processing shows me an error at this point:

 public void RENDER (float H) {
     beginShape();
   for(int i=0;i < npoints;i++){
     vertex(xpoints[i],ypoints[i],H);
   }
   endShape(CLOSE);
 }

There are about 10000 polygons render with this loop;

ERROR MESSAGE :

xception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1

at processing.core.PGraphics3D.addLineWithoutClip(PGraphics3D.java:1106)

at processing.core.PGraphics3D.addLineWithClip(PGraphics3D.java:1082)

at processing.core.PGraphics3D.addLine(PGraphics3D.java:1065)

at processing.core.PGraphics3D.endShapeStroke(PGraphics3D.java:768)

at processing.core.PGraphics3D.endShape(PGraphics3D.java:608)

at processing.core.PGraphics.endShape(PGraphics.java:1133)

at processing.core.PGraphics.quad(PGraphics.java:1418)

at processing.core.PGraphics.rectImpl(PGraphics.java:1471)

at processing.core.PGraphics.rect(PGraphics.java:1466)

at processing.core.PApplet.rect(PApplet.java:6953)

at NEIGHBOORHOODS_GROWTH_7_MULTI$SITE_COLLECTION.UPDATE_SAMENB(NEIGHBOORHOODS_GROWT
H_7_MULTI.java:1013)

at NEIGHBOORHOODS_GROWTH_7_MULTI$SITE_COLLECTION.PLACE_FUNKTION(NEIGHBOORHOODS_GROW
TH_7_MULTI.java:1276)

at NEIGHBOORHOODS_GROWTH_7_MULTI.keyPressed(NEIGHBOORHOODS_GROWTH_7_MULTI.java:163)


at processing.core.PApplet.handleKeyEvent(PApplet.java:1730)

at processing.core.PApplet.checkKeyEvent(PApplet.java:1764)

at processing.core.PApplet.keyPressed(PApplet.java:1776)

at java.awt.Component.processKeyEvent(Component.java:5541)

at java.awt.Component.processEvent(Component.java:5360)

at java.awt.Container.processEvent(Container.java:2010)

at java.awt.Component.dispatchEventImpl(Component.java:4050)

at java.awt.Container.dispatchEventImpl(Container.java:2068)

at java.awt.Component.dispatchEvent(Component.java:3885)

at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1826)

at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManage
r.java:681)

at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusMan
ager.java:938)

at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusMan
ager.java:810)

at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.j
ava:645)

at java.awt.Component.dispatchEventImpl(Component.java:3923)

at java.awt.Container.dispatchEventImpl(Container.java:2068)

at java.awt.Component.dispatchEvent(Component.java:3885)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
69)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190
)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Re: P3D RENDER PROBLEM
Reply #1 - Jan 28th, 2009, 9:09am
 
couple of things i would look at/ think about.  Try constraining npoints so it can't be negative (or make it absolute).  Second; maybe there is a max size array within a beginShape endShape call (let's say it the max display list size or some such thing)...trying breaking the render up into several smaller runs between begin-end.....
finally it may be worth checking that something is not rolling over from a max value to a negative value.  Not sure how big max int is defined to be in processing but if you go over that i seem to remember that the value will go negative depending on how int's are represented?

Anyhow my coding is very rusty but this would be the low hanging fruit i would try to check first.
Page Index Toggle Pages: 1