I m trying to implementing Terrain following for that i am using a pick tool class Setting its PickRay to Start at My current Postion and Pointing Vertically down
Then i pick the closest result into a PickResult Object and from this result i query intersection(0) This is working absolutely fine when i make it walk on the Random shape3D Object that i made but my world consist of Models imported from the 3DMax studios (using 3ds loader) when i try to make my avtar walk on this terrain it walks fine for some time and crashes with java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.RangeCheck(ArrayList.java:507) at java.util.ArrayList.get(ArrayList.java:324) at ViewPointTest.PickResult.getIntersection(PickResult.java:457) at ViewPointTest.SimpleKeyBehavior.processStimulus(SimpleKeyBehavior.java:86) at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:172) at javax.media.j3d.J3dThread.run(J3dThread.java:250) at ...intersect = picked.getIntersection(0); I have no idea why this is comming So i Tryied and traced the Pickresult class for any answere i found that my Shape has geometry of type TriangleStripArray at the point of Exception my observations are: 1) program control reaches till that point where the PickResult is not null but ( I don't understand why !!) the intersection(0) gives out of bounds..i mean why should it logically speaking when i can see ground underneath and somthing has been picked why should the intersections be none!! 1) When stripVertexCounts in method - boolean intersectTSA(TriangleStripArray geom, int geomIndex,Point3d[] pnts, boolean firstpick, PickIntersection pi) in class Pick Result grows more than 186 in count (ofcourse i don't have enough number of samples to give an exact number, i suspect that it has something to do with increasing count) then suddenly this error is thrown 2) at that Point the Method static boolean intersectRayOrSegment returns false and it crashes with the exception as mentioned earlier Some help from someun?? Reagrds Ashish __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".