Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (468)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Geometry disappears after updateData()  (Read 1416 times)
0 Members and 1 Guest are viewing this topic.
Offline Spasi
« Posted 2002-11-05 12:16:35 »

Hello everyone,

From J3D Tutorial:
"Keep in mind that while an application could modify BY_REFERENCE geometry data without using a GeometryUpdater object this, should be avoided as the results of doing so are neither predictable nor portable."

I know I should not update BY_REFERENCE geometry outside a GeometryUpdater's updateData method, but the design of my system makes using a GeometryUpdater like that almost impossible (rather awkward actually). So, what I've done goes like this: Within a Behavior's processStimulus, I update geometry data (coords and normals) "my way", then go to all the Geometries that I "touch" and call updateData() in each one of them. As a parameter I pass a GeometryUpdater with an empty updateData(Geometry geometry) {}. This way I inform J3D that my geometry changed, so that it can compute the new bounds and whatever else it needs to do. Or so I thought.

I use this technique with two kinds of geometries. One is an IndexedQuadArray and the other a TriangleStripArray. There are a series of Shape3Ds and each uses one of these two kinds of geometries. The problem is that it works fine with the IndexedQuadArrays (they update correctly) but when I try the same on a TriangleStripArray, the geometry just disappears  :-/. I run some tests and after the updates, Shape3Ds are in place, coordinates are in place, normals are correctly calculated, the geometry is just "there". But somehow it "dissapears" after calling the updateData(). Even the frame rate goes significantly up, as if I had removed the Shape3Ds completely.

Any thoughts of why such a thing happens? All necessary capabilities are set, no exception is thrown. Shouldn't it work, since I call updateData anyway?  Huh

P.S.: I don't update the Geometries within updateData, because I need to update many different Geometries at once. It would be a mess if I had to split the whole update procedure into each Geometry.
Offline Spasi
« Reply #1 - Posted 2002-11-05 21:24:58 »

Actually, the geometry disappears even if I don't mess with it in any way. Just calling updateData(updater) and it goes away! The updater does nothing, I don't change anything out of it and it still disappears. I even tried to put some code in the GeometryUpdater's updateData(Geometry geometry), with no luck.

I cannot find a way to work it out, or even understand why such a behavior occurs. It happens only when I try to update a TriangleStripArray. I'm on JDK 1.4.1_01, Java3D 1.3 OpenGL, GeForce2, WinXP. Could this be a bug in the J3D APIs? Has anyone experienced such a problem before?
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

theagentd (6 views)
2014-04-24 23:00:44

xsi3rr4x (83 views)
2014-04-15 18:08:23

BurntPizza (75 views)
2014-04-15 03:46:01

UprightPath (86 views)
2014-04-14 17:39:50

UprightPath (69 views)
2014-04-14 17:35:47

Porlus (86 views)
2014-04-14 15:48:38

tom_mai78101 (109 views)
2014-04-10 04:04:31

BurntPizza (169 views)
2014-04-08 23:06:04

tom_mai78101 (265 views)
2014-04-05 13:34:39

trollwarrior1 (216 views)
2014-04-04 12:06:45
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!