Why don't you make the original array big enough ? Florin
-----Urspr�ngliche Nachricht----- Von: greg baboolal [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 22. Januar 2003 09:59 An: [EMAIL PROTECTED] Betreff: Re: [JAVA3D] A little help with code - setCoordinates Hi Brad, I will look into it, will this work even if the new array is not the same length (greater than) the original? Cheers, Greg. --- Brad Christiansen <[EMAIL PROTECTED]> wrote: > Hi, > > If you keep a referance to your original coord array > then you can simply change the values in that array > directly in the > updateData() method. It goes something like the > 'kinda-code' snippet below. If you use BY_REF > correctly you shouldn't need to > set anything other than the values in your original > arrays. > > eg > > double[] coords; > > initGemo() { > coords = new duoble[2]; > .. > .. > la = new LineArray(.. BY_REF ..); > ga.setCoords(0, coords); > > } > > updateData(..) { > coords[0] = 1245.123; > coords[1] = 1334.234; > } > > > Cheers, > > Brad > > greg baboolal wrote: > > > > Hi, > > > > After an intermittent 12-hr period I finally > decided > > to put the monkey-typewriter-shakesphere theory to > > test and came up with a remedial solution, that is > > > > line.updateData( new GeometryUpdater() { > > public void updateData(Geometry g) { > > g = shape3D.getGeometry(); > > LineArray tempLine = (LineArray) g; > > tempLine = lineArray( verts2 ); > > shape3D.setGeometry( tempLine ); > > } > > }); > > > > Still amazed that I had to initiate a new > LineArray > > but it beats the overhead of a branchGroup. If > there > > is a cleaner way to have done this please > enlighten > > me. > > > > Thanks, > > Greg. > > > > --- greg baboolal <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > Florin thanks for the observation, I have now > > > implemented the switch group. > > > > > > It seems to do the job, except there is one > little > > > part of th app which I can't get right now: > > > > > > I create a LineArray shape initial only having 2 > > > verts, the ball's current position, however I > then > > > need to be able to update the LineArray with a > new > > > set > > > of co-ordinates, at present i'm using: > > > > > > line.setValidVertexCount(verts.length); > > > line.setCoordinates( 0 , verts ); > > > > > > where verts is the new array set. > > > > > > but I keep getting the following error: > > > initial vertex index + valid vertex count > > vertex > > > count > > > > > > Can anyone help? > > > > > > Greg. > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > > > Do you Yahoo!? > > > Yahoo! Mail Plus - Powerful. Affordable. Sign up > > > now. > > > http://mailplus.yahoo.com > > > > > > > > > =========================================================================== > > > 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". > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > > http://mailplus.yahoo.com > > > > > =========================================================================== > > 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". > > > ---------------------------------------------------------------------------- > This Email may contain confidential and/or > privileged information and is > intended solely for the addressee(s) named. If you > have received this > information in error, or are advised that you have > been posted this Email by > accident, please notify the sender by return Email, > do not redistribute it, > delete the Email and keep no copies. > ---------------------------------------------------------------------------- > > =========================================================================== > 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". __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com =========================================================================== 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". ==========================================================================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".
