Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2389 times)
0 Members and 1 Guest are viewing this topic.
Offline Spasi
« Posted 2002-11-05 11: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 20: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  

EgonOlsen (79 views)
2018-06-10 19:43:48

EgonOlsen (59 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (261 views)
2018-05-13 18:23:11

nelsongames (160 views)
2018-04-24 18:15:36

nelsongames (158 views)
2018-04-24 18:14:32

ivj94 (901 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (813 views)
2018-03-24 14:43:53

Solater (177 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!