There is a way to get setValidVertexCount to work. I have done if with a
LineArray object. What you have to do is to modify some other property (eg
color) of the GeometryArray before you set the valid vertex count.

For example:

LineArray la;
la.setColor(0, col);
la.setValidVertexCount(2);

This works fine for me. Taking out the setColor line stops it from working.

Andrian

----- Original Message -----
> You got it right, setValidVertexCount just doesn't work.
> It's not fixed in the next beta release, either (at least not for
> TriStripArrays).
> You'll have to come up with another way to create the effect you want
until the
> fixed is made.
> I had to just all my unused geometrys to a location off screen, or down to
a
> point.
> Good luck!
>
> Kenneth Gordon wrote:
>
> > I'm a little confused about the setValidVertexCount() function inside
> > GeometryArray objects.  What it says in the documentation is:
> >
> >      "This count specifies the number of vertices actually used in
> >      rendering or other operations such as picking and collision."
> >
> > I understood this to mean that if you have an array of 5 vertices but
> > you call setValidVertexCount(2), it will only render the first 2
> > vertices.  Am I incorrect in my interpretation of this?  I have written
> > several different test programs, and in all variations it renders all
> > the vertices in the array, not just the subset I want.  If this is not
> > the correct way to do render a portion of a vertex array, can someone
> > please let me know how this can be done?
> >
> > Basically, my application needs to draw a line following behind a moving
> > object, showing a history of where it has been.  Obviously when the
> > application starts, it needs to be of length 0.  Then, each time the
> > object moves (basically every frame), an additional point will be added
> > to the history.  What I intended to do was create one array of size 1000
> > (the maximum number of points that this history can have).  Then, each
> > time it moves I update the proper point in the array and tell Java3D
> > that the number of points in the array that it needs to render has
> > increased by one.
> >
> > Anyway, if I am using setValidVertexCount incorrectly, or if there is
> > another way I can do the same thing, please let me know.
> >
> > Thanks, in advance!
> >
> > -- Ken
> >

===========================================================================
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".

Reply via email to