Rob,

This is the expected behavior.  If you call "addGeometry", it will add
the geometry to the end of the list of geometries that are already in
the Shape node.  For backward compatibility with Java 3D 1.1, a Shape3D
node is initialized with a single null Geometry reference at index 0.
Calling addGeometry as follows:

        Shape3D s = new Shape3D();
        s.addGeometry(geom);

will add "geom" as the second element (index 1).  A null reference will still
be there at index 0.  Unless you are trying to use multiple geometries, you
should use setGeometry rather than addGeometry.

--
Kevin Rushforth
Java 3D Team
Sun Microsystems

[EMAIL PROTECTED]


>Date:         Wed, 15 Nov 2000 11:08:58 -0000
>From: Rob Nugent <[EMAIL PROTECTED]>
>Subject:      Re: [JAVA3D] Exception with 1.2.1 beta 1 (OGL)
>To: [EMAIL PROTECTED]
>
>Uma,
>
>I just checked my app. I am adding a single Geometry to my Shape3D, but
>when I call 'numGeometries()' it returns 2. The two geometries returned
>using 'getGeometry(int)' are reported as 'null' and the geometry I added
>respectively.
>
>I assume that you are aware of this part of the problem ? It is unclear from
>your
>notes whether you know that the no-params 'addGeometry()' is behaving in
>this manner.
>
>Thanks
>Rob
>
>
>Rob Nugent
>Development Manager
>Critical Path Southampton
>[EMAIL PROTECTED]
>http://www.cp.net
>Tel: +44 (0) 1489 585503
>Fax: +44 (0) 1489 881363
>
>----- Original Message -----
>From: "Uma Sabada" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, November 14, 2000 8:51 PM
>Subject: Re: [JAVA3D] Exception with 1.2.1 beta 1 (OGL)
>
>
>> Qiuli:
>>
>> This problem is fixed in 1.2.1 beta2.  You could workaround the problem in
>one of 2
>> ways:
>>
>> 1.  Disable compile - Disabling compile in 1.2.1 beta1 should still give
>you the
>> same performance as .compile() in 1.2 while allowing you to benefit from
>any bug
>> fixes in 1.2.1 beta1.
>>
>> 2.  Rearrange geometry - This bug occurs if you use shapes with multiple
>geometry
>> and the first geometry is null.  You could rearrange your geometry list in
>the
>> shape such that the first entry is non-null.
>>
>>
>> -Uma
>> Java3D Team
>>
>> > MIME-version: 1.0
>> > X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
>> > Importance: Normal
>> > X-Priority: 3 (Normal)
>> > X-MSMail-priority: Normal
>> > Date: Tue, 14 Nov 2000 14:05:51 -0800
>> > From: Qiuli Sun <[EMAIL PROTECTED]>
>> > Subject: Re: [JAVA3D] Exception with 1.2.1 beta 1 (OGL)
>> > To: [EMAIL PROTECTED]
>> >
>> > I got the same problem. So I removed the 1.2.1 beta.
>> >   -----Original Message-----
>> >   From: Discussion list for Java 3D API
>> > [mailto:[EMAIL PROTECTED]]On Behalf Of Rob Nugent
>> >   Sent: Tuesday, November 14, 2000 1:48 AM
>> >   To: [EMAIL PROTECTED]
>> >   Subject: [JAVA3D] Exception with 1.2.1 beta 1 (OGL)
>> >
>> >
>> >   Hi,
>> >
>> >   I just tried to move to Java 3D 1.2.1 beta 1 (OGL version) on WinNT
>4.0
>> >
>> >   I was previously on Java 1.2 (also OGL)
>> >
>> >   I am now getting the following exception which wasn't occurring before
>:
>> >
>> >   Exception in thread "main" java.lang.NullPointerException
>> >           at
>javax.media.j3d.CompileState.addShape(CompileState.java:156)
>> >           at
>> > javax.media.j3d.Shape3DRetained.merge(Shape3DRetained.java:1716)
>> >           at
>javax.media.j3d.GroupRetained.merge(GroupRetained.java:1788)
>> >           at
>> >
>javax.media.j3d.TransformGroupRetained.compile(TransformGroupRetained.java:3
>> > 08)
>> >           at
>javax.media.j3d.GroupRetained.compile(GroupRetained.java:1761)
>> >           at
>> >
>javax.media.j3d.BranchGroupRetained.compile(BranchGroupRetained.java:146)
>> >           at
>> >
>javax.media.j3d.BranchGroupRetained.compile(BranchGroupRetained.java:121)
>> >           at javax.media.j3d.BranchGroup.compile(BranchGroup.java:82)
>> >           at rob.ref.Slab.<init>(Slab.java:649)
>> >           at rob.ref.Wall.doSlab(Wall.java:66)
>> >           at rob.ref.Room.doWallSlabs(Room.java:472)
>> >           at rob.ref.House.init(House.java:119)
>> >           at rob.ref.House.setRooms(House.java:168)
>> >           at rob.ref.ManorHouse.<init>(ManorHouse.java:51)
>> >           at rob.ref.Start.init(Start.java:286)
>> >           at rob.ref.Start.main(Start.java:415)
>> >
>> >   Any suggestions ?
>> >
>> >   Thanks
>> >   Rob
>> >
>> >
>> >   Rob Nugent
>> >   Development Manager
>> >   Critical Path Southampton
>> >   [EMAIL PROTECTED]
>> >   http://www.cp.net
>> >   Tel: +44 (0) 1489 585503
>> >   Fax: +44 (0) 1489 881363
>> >
>>
>>
>===========================================================================
>> 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".
>

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