Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (604)
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  
  Dead branchgroups still visible?  (Read 897 times)
0 Members and 1 Guest are viewing this topic.
Offline Breakfast

Senior Devvie




for great justice!


« Posted 2003-07-17 08:02:59 »

How is it possible to have branchgroups that are not live but are part of a visible scene?
Offline Breakfast

Senior Devvie




for great justice!


« Reply #1 - Posted 2003-07-17 10:26:52 »

A bit more checking - it only happens when I have left and returned to the Java3D panel - it then creates the scengraph completely correctly, but somehow destroys it between creating and displaying it and performing any picking on it - the MousePressed action finds the branchgroup null.

Can anyone suggest a reason for this seemingly inexplicable behaviour?
Offline misterX

Junior Devvie




java forever!


« Reply #2 - Posted 2003-07-17 13:59:18 »

As far as i know, if a BG is visible, then it 'lives', and this by definition (the reciprocal isn't true).

Do you mean what's displayed changes when the window lose focus and gain it again?!?  Huh Shocked Huh

Quote

it then creates the scengraph completely correctly, but somehow destroys it between creating and displaying it

I suppose, you don't see what you expected, or even nothing, right? Then:
1) how can you know the scene is correctly created when you see the wrong result?
2) If it is truly correctly build and added, have you checked some usual "forgot-things" (lights, view, adding BG somewhere, obsolete transforms..)?
3) If it's an animated scene, maybe ongoing behaviors is the reason of unexpected results(?)
Quote

and performing any picking on it - the MousePressed action finds the branchgroup null.

Does it happen when you click on visible objects, or the place they should without seeing them?
(And the flag ENABLE_PICK_REPORTING flag is set i suppose)


These are just thoughts...
...I think it needs some more details to help you out.
Cheers
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Breakfast

Senior Devvie




for great justice!


« Reply #3 - Posted 2003-07-17 14:41:46 »

This is what is confusing me. The scene is created entirely correctly - looking exactly the same as it did when I left it.  It displays perfectly and the rotation behaviour responds as expected. It is only when I click on the canvas to perform some kind of picking that the error occurs.

The class I am working from maintains the root branchgroup internally while it exists. A watch in the debugger following that branchgroup finds it correct and live until the beginning of the mouseClicked method (the class implements MouseListener) whereupon the branchgroup is recorded as Null. There is only one method in the class that can make it null and that is not being called - or at least it's breakpoints aren't triggered.

The only thing I can think of is that because I am recycling the same Canvas3D, due to previously mentioned problems with it drawing a huge black rectangle if I created a new one, the picking methods are somehow trying to use the old Canvas3D.

When I remove my class I call this method- is there any way traces of the pickCanvas could be being maintained after this?
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public void roomClear()
{
        System.err.println("\n***We are clearing this room!\n***");
        Viewer[] ox = ourView.getViewers();
        for( int p=0;p<ox.length;p++)
                 ox[p].getView().removeAllCanvas3Ds();
        ourView.detach();
        ourBG.detach();
        ourView = null;
        ourBG = null;
}
Offline Breakfast

Senior Devvie




for great justice!


« Reply #4 - Posted 2003-07-17 14:58:32 »

Alright then, I have fixed it, largely thanks to writing the above post.

I was adding the object to the Canvas3D as a mouselistener but I was never removing it, so although I thought I was getting rid of it, I was keeping that one reference and when I created a new one it kept trying to use the old one instead.  A Canvas.removeMouseListener(this) did the trick.
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.

Mr.CodeIt (13 views)
2014-12-27 04:03:04

TheDudeFromCI (17 views)
2014-12-27 02:14:49

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (56 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (92 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (86 views)
2014-12-05 12:39:02

SHC (97 views)
2014-12-03 16:27:13

CopyableCougar4 (102 views)
2014-11-29 21:32:03
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50
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!