Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 07:19:07 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Possible Bounds Problem
Pages: [1]
Print
Author Topic: Possible Bounds Problem  (Read 1501 times)
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« on: 21. February 2007, 03:04:17 am »

I just updated to the newest SVN (My old stuff was maybe a week old). Now my objects seem to be disappearing at certain viewing angles. I'm guessing it might have something to do with the bounds. Does any one have any other ideas what might be causing this?
« Last Edit: 24. February 2007, 02:45:37 pm by Marvin Fröhlich » Logged

"I like my method, what was my method again?" - Jon
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 21. February 2007, 03:29:54 am »

I just updated to the newest SVN (My old stuff was maybe a week old). Now my objects seem to be disappearing at certain viewing angles. I'm guessing it might have something to do with the bounds. Does any one have any other ideas what might be causing this?

I also noticed just a new bounds problem like you describe. Man I hate those bounds! Well, you could play around with the setShowBounds() method to visualize you Shapes' and Groups's Bounds. Then you will know more. But I will definitely have to investigate the bounds another time.

Marvin
« Last Edit: 24. February 2007, 02:45:46 pm by Marvin Fröhlich » Logged
khangharoth
Enjoying the stay
*
Offline Offline

Posts: 67


View Profile Email
« Reply #2 on: 21. February 2007, 03:40:19 am »

yaa its happening to me also , but at least we know what's the problem is  Smiley
« Last Edit: 24. February 2007, 02:45:53 pm by Marvin Fröhlich » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 21. February 2007, 04:03:59 am »

In the meantime you can force all your Nodes to be visible at all times by diabeling frustum culling. Of course this costs performance.

Do it like this:
Code:
RenderPass rp = env.addPerspectiveBranch( ... );

rp.setFrustumCullingEnabled( false );

Maybe you have added your Nodes differently to the SceneGraph, but searching through SceneGraph's/Xith3DEnvironment's add*() methods, you will certainly find, how to get your current RenderPass.

Marvin
« Last Edit: 24. February 2007, 02:46:02 pm by Marvin Fröhlich » Logged
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #4 on: 21. February 2007, 03:59:39 pm »

Well, you could play around with the setShowBounds() method to visualize you Shapes' and Groups's Bounds.

I've never gotten this to work. I'm just calling setShowBounds() on the Models I load. What else do I have to do to get this to show up?
« Last Edit: 24. February 2007, 02:46:09 pm by Marvin Fröhlich » Logged

"I like my method, what was my method again?" - Jon
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #5 on: 21. February 2007, 06:05:46 pm »

I find that setShowBounds does not work with Links so you may not see anything if most of your objects are Links to SharedGroups as are most of mine.  Since I've been using Links for quite a while now, I don't know if anything has changed; however, setShowBounds( true ) used to work fine for me.
« Last Edit: 24. February 2007, 02:46:18 pm by Marvin Fröhlich » Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 21. February 2007, 07:03:47 pm »

The Bounds display code was not working for a while. But with the recent bounds fixes, I also fixed this part. It should work now (also with Links).

The Leaf class has a special method showBounds(boolean), that just calls showBounds( show,false ). So on a Link, the "children" (SharedGroup) are not set to show bounds. better call sharedGroup.setShowBounds( true, true ). This works. I've tested it.

Well, as I said, I will have a look at the Bounds code today or tomorrow. If there's anything wrong with it now, I will fix it.

Marvin
« Last Edit: 24. February 2007, 02:46:26 pm by Marvin Fröhlich » Logged
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #7 on: 21. February 2007, 09:23:08 pm »

I'm calling

Code:
Model model = loader.loadModel( resLoc.getResource(objFile));
model.setShowBounds(true,true);

but I don't see any difference on any of the loaded models.
« Last Edit: 24. February 2007, 02:46:34 pm by Marvin Fröhlich » Logged

"I like my method, what was my method again?" - Jon
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #8 on: 21. February 2007, 11:24:56 pm »

I have tested six cases with the OBJLoaderTest in xith-tk and Bounds.

I've added one of the three lines between lines #106 and #107:
Code:
model.setShowBounds( true, true ); // shows all Bounds including the child Node's ones
Code:
model.setShowBounds( true, false ); // shows only the bounds of the model Group itself
Code:
model.getShapeNodes().get( 0 ).setShowBounds( true );

All the cases also work when the model is in a Link/SharedGroup and look just the same.

I've attached screenshots, that show the results. Though the bounds should be displayed in red (for GroupNodes) and green (Shape3Ds), it is working sufficiently.

Please try the above.

Marvin
« Last Edit: 24. February 2007, 02:46:45 pm by Marvin Fröhlich » Logged
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #9 on: 22. February 2007, 10:44:41 pm »

I think I found my problem

I'm using...

Code:
Iterator<Shape3D> it = model.getShapeNodes().iterator();

while(it.hasNext()){
GeometricMath.multiply(it.next(),scale);
}

...to scale the objects I'm loading. If I take it out everything seems to work fine. Is GeometricMath not suppose to update the bounds, or is it broken?
« Last Edit: 24. February 2007, 02:46:59 pm by Marvin Fröhlich » Logged

"I like my method, what was my method again?" - Jon
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #10 on: 22. February 2007, 11:22:28 pm »

...to scale the objects I'm loading. If I take it out everything seems to work fine. Is GeometricMath not suppose to update the bounds, or is it broken?

Even if I didn't test is properly, I was assuming, that it did. But this is certainly one of the easier tasks to fix Smiley.

Marvin
« Last Edit: 24. February 2007, 02:47:09 pm by Marvin Fröhlich » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #11 on: 22. February 2007, 11:27:15 pm »

Wow, it was really easy to find (in Shape3D). It's fixed now. Please check it out. Maybe this even was the reason for the other bounds problems.

Marvin
« Last Edit: 24. February 2007, 02:47:18 pm by Marvin Fröhlich » Logged
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #12 on: 22. February 2007, 11:38:08 pm »

Wow, it was really easy to find (in Shape3D). It's fixed now. Please check it out. Maybe this even was the reason for the other bounds problems.

Marvin
I was just looking at that when I saw your last post. I've updated and it seems to have fixed all of my problems.
« Last Edit: 24. February 2007, 02:47:27 pm by Marvin Fröhlich » Logged

"I like my method, what was my method again?" - Jon
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #13 on: 22. February 2007, 11:50:01 pm »

I was just looking at that when I saw your last post. I've updated and it seems to have fixed all of my problems.

Really cool. Happy to read that.

Marvin
« Last Edit: 24. February 2007, 02:47:37 pm by Marvin Fröhlich » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic