Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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  
  Bounds are _not_ working for me.  (Read 1263 times)
0 Members and 1 Guest are viewing this topic.
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Posted 2004-11-27 16:25:20 »

I have an TransformGroup to which I give a BoundingSphere.  In the game, the TransformGroup moves and rotates.  I used setShowBounds on it and the bounding sphere I see doesn't really move with it.  First of all, I should say that it doesn't matter what radius I specify the bounds (even 0), it starts out huge.  Whenever the transformgroup rotates the boundingsphere moves up and down (or increases in size).  Also, as the transform group moves along the negative z axis, the bounding sphere moves down (goes up the Y axis), or reduces in size.

Setting the bounds center and radius to the coordinates of the TG whenever it moves changes nothing, it still behaves the same way.  And so the way it looks is that though the sphere moves, it doesn't move the with the TG.

I think this may be a bug in Xith? In my coordinate system I have the netagive Y axis as up (out of the screen), the positive Z axis as ... up (towards the top of the screen), and the positive X axis as right.  (The view is looking down at the XZ plane with the positive Z axis as up).

What's going on? I'm probably not doing something correctly...

Edit: BTW, the view moves with the TG, I think this could be causing the problem for some reason.

Edit: Ok, when adding bounds to some stationary objects they too are weird.  They are stationary "with the view".  So as the view moves with the TG, the stationary bounds show up only when the actual objects are in the vicinity, and they move only with the view, they don't stay in their place in space.

Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #1 - Posted 2004-11-27 17:00:47 »

Here's a screenshot of what's happening (using latest CVS btw):

The bounds exist, but they only show up when the view comes near the planets, and they are in the wrong place (to the upperleft and above the planets), and they move with the view.

The third bounding sphere you see there is the ship's bounding sphere, and it moves all over the place like described in the first post.

Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #2 - Posted 2004-11-28 22:10:12 »

Come now, surely somebody else is experiencing this problem? Bounds are rather important aren't they?

Edit: here is some code if it helps:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
Transform3D tf = new Transform3D();
                  tf.rotXYZ(FastMath.randomFloat(),FastMath.randomFloat(),FastMath.randomFloat());
                  tf.setTranslation(new Vector3f(x, distback, z));
                 
                  TransformGroup tg = new TransformGroup();
                 
                  BoundingSphere bounds = new BoundingSphere(new Point3f(0,0,0), radius+100);
                  tg.setBounds(bounds);
                  tg.setShowBounds(true, true);
                 
                  tg.addChild(shape);
                  tg.setTransform(tf);
                  planets.addChild(tg);

That's for adding the planets to the scenegraph.  The path to the planets looks like this:
Main BranchGroup > planets > various TG's containing the planets, with bounding sphere's applied to the TG's as seen above.

The path to the ship looks like this:
Main BG > shipbg > shipTG.  The boundingsphere is applied to the shipTG.

Changing various things like adding extra branchgroups between the main BG and the ship and planet's doesn't work.  And the weirdest thing of all that probably proves this is a bug and not my fault is that the bounding sphere's of the planets show up only when the View is "in their region", and they move _with_ the View as if they were in a foreground now that was fixed (there are no forground nodes in this scenegraph and the view does not contain any children).

Edit: Also, I noticed that when I apply the bounds to the actual Shap3D object of the planets, whenever the view shows a planet, the whole render looks like it becomes "tinted" to a darker, almost reddish color... I have _no_ idea why it's doing this, all I know is that I'm getting really frustrated...

Edit: Oh come on... I just did a simple test with some simple code and even tried adding a BoundingBox to the thing.  It still came out as a huge circle just like the one around the ship.  Am I seriously the only one experiencing this problem?

Are bounds not important anymore or something?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #3 - Posted 2004-12-05 09:18:52 »

I myself haven't done anything with Bounds yet, but i know, that there's something called Odejava that controlls collisions and stuff. Then you wouldn't need to work with the bounds in xith3d.

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #4 - Posted 2004-12-05 11:56:54 »

Hi,

I did not use bounds rendering option for a long time but I will guess that the problem is in bounds rendering code, not in the bounds calculation.

Typically you do not need to add bounds manually, because of they are autocomputed by default, but you can control it yourself by setIgnoreBounds(...), setBoundsAutoCompute(...), setBounds(...) etc.

Yuri

P.S. If you really think this is a bug, please prepare a test case and file an issue so we can take a closer look to this.

Yuri Vl. Gushchin
JProof Group
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #5 - Posted 2004-12-05 12:02:29 »

Quote
Hi,

I did not use bounds rendering option for a long time but I will guess that the problem is in bounds rendering code, not in the bounds calculation.

Typically you do not need to add bounds manually, because of they are autocomputed by default, but you can control it yourself by setIgnoreBounds(...), setBoundsAutoCompute(...), setBounds(...) etc.

Yuri

P.S. If you really think this is a bug, please prepare a test case and file an issue so we can take a closer look to this.

Alright thanks for the conformation, how do I prepare a test case and file it...?

Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #6 - Posted 2004-12-05 12:15:05 »

Hi,

As simple as possible, something like a test cases in com.xith3d.test package.

Then join dev.java.net if you are not a member yet, and request Observer or BetaTester role for Xith3D project. Then I will approve you and you will be able to file an issue with IssueZilla at dev.java.net.

After you file an issue, attach zipped test case with all necessary info (textures, .bat files, etc.) to the issue.

I know this is boring to do all this, but this will save a lot of time for others.

Yuri


Yuri Vl. Gushchin
JProof Group
Offline itistoday

Junior Member




There's too much blood in my caffeine system.


« Reply #7 - Posted 2004-12-05 13:36:37 »

Quote
Hi,

As simple as possible, something like a test cases in com.xith3d.test package.

Then join dev.java.net if you are not a member yet, and request Observer or BetaTester role for Xith3D project. Then I will approve you and you will be able to file an issue with IssueZilla at dev.java.net.

After you file an issue, attach zipped test case with all necessary info (textures, .bat files, etc.) to the issue.

I know this is boring to do all this, but this will save a lot of time for others.

Yuri


Alright thanks, I've submitted a request for the Observer.

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #8 - Posted 2005-03-07 14:09:40 »

Hi

I've got the same problem !!

And I think I know why the Bounds are not drawn correctly!! Shocked

In my scene I've got a view which I can move around. But when I move it the Bounds move with it - meaning they don't stay with the objects they're bounds for. So i got to the conclusion that the Bounds are somehow seperately drawn onto the Canvas and therefore don't stay at their correct position. They should be, when the view is at (0|0|0).

Correct me if I'm wrong and just have done a simple mistake.

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #9 - Posted 2005-03-07 17:17:20 »

Correct me if I'm wrong, bounds are a deprecated package of Xith3D that was maintained by David Yazel.
The best solution now is to use Odejava, as a lot of peoples do.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #10 - Posted 2005-03-08 04:16:18 »

sure - but how can I do picking with Odejava ?
I wanted to use the Bounds to reduce my picking in xith (first check if the ray intersects the Bounds, then get the triangles - this should reduce the amount of triangles to be tested)

:: JOODE :: Xith3d :: OdeJava ::
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #11 - Posted 2005-03-08 14:19:59 »

Ok I don't have to see the Bounds anymore - I fixed my problem. Smiley

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #12 - Posted 2005-03-08 17:00:45 »

Quote
sure - but how can I do picking with Odejava ?
I wanted to use the Bounds to reduce my picking in xith (first check if the ray intersects the Bounds, then get the triangles - this should reduce the amount of triangles to be tested)


If your Odejava geoms and body are linked with Xith3D geoms and shapes, this works same as pure Xith3D, I think.
I use Odejava, but I don't began to test picking yet.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (39 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (36 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
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

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!