Nope, it's not the case. It's very simple, the getBounds().getCenter() simply doesn't return the geometric center of the object. That is way before anything is sent to the graphic card and is only related to the use of BoundingSpheres. I'm attaching a simple picture to show you the difference.
The scene graph is composed of two blue rectangles. With green is represented the scene graph center calculated with bounding boxes, and with red is the center calculated with bounding spheres. You can see that there is quite a difference. As the complexity of the scene increses, the distance between the two "centers" increases too. If you try to construct that scene and then use the OrbitBehavior to rotate around it, fixing the rotation center to the one obtained with the default getBounds, you will see the it rotates slightly displaced. Cheers, Florin P.S. The picture was hand drawn, so it may not be perfect, but I think you can get the ideea. -----Urspr�ngliche Nachricht----- Von: Elisabeth Thorsen [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 30. Januar 2003 09:19 An: [EMAIL PROTECTED] Betreff: Re: [JAVA3D] AW: [JAVA3D] objectBehaviour.setRotationCenter() spurious shift Hi, Here is a part of a previous email I sent to Kelvin Chung (and to this discussion list). Maybe this has something to do with your problem.... I while ago I reported a bug in OrientedShape3D (Bug 4762753 - Precision problem of OrientedShape3D.ROTATE_ABOUT_POINT if far away from origin), and you told me I could use Rasters instead. etc. etc. Kelvin Chung replied: The previous (bug 4762753) bug turns out not a Java3D bug. The precision is lost in the PC card pipeline when big floating point pass in to the underlying driver. Using our own Sun's graphics cards it can't reproduce. Elisabeth :-) -----Original Message----- From: Florin Herinean [mailto:[EMAIL PROTECTED]] Sent: 30. januar 2003 09:10 To: [EMAIL PROTECTED] Subject: [JAVA3D] AW: [JAVA3D] objectBehaviour.setRotationCenter() spurious shift I don't know about any "ObjectBehavior", but I suspect you are speaking about OrbitBehavior. In that case, I can tell you that I am using setRotationCenter(Point3d) without any problem. The OrbitBehavior is rotating EXACTLY around the center I'm specifying, without any need of strange workarounds as the one you show me below. However, I think I know the problem you have run into, because I had it too. So let me explain what I think is happening, and if it's not like that you can correct me. The problem is that the point you specify as rotation center is not the one that you expects to be. How are you obtaining the rotation center ? Do you use something like ((BoundingSphere)<your object>.getBounds()).getCenter() ? In that case, I can tell you that the center is not the one you expect, except the case when you have set manually the bounds. Actually, I found quite annoying that getBounds is not returning the closest bounds of the object. In my program I am turning boundsAutoCompute off and calculate and set the bounds by my own, so that I know that they have correct values. All the problem comes from the fact that, by default, the bounds auto compute uses bounding spheres instead of bounding boxes, and that makes objects to look bigger and displaced. Cheers, Florin -----Urspr�ngliche Nachricht----- Von: Alex Bowden [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 30. Januar 2003 03:00 An: [EMAIL PROTECTED] Betreff: [JAVA3D] objectBehaviour.setRotationCenter() spurious shift Hi all has anyone successfully managed to modify the setRotationCenter() method of ObjectBehaviour so as to avoid the spurious shift of the new center of rotation onto the center of view. Andrea Tartaro [[EMAIL PROTECTED]] back in 04/04/2001 replied to a query to the group on this topic agreeing that the behaviour was odd and suggesting xtrans += (rotationCenter.x-center.x); ytrans += (rotationCenter.y-center.y); at the beginning of setRotationCenter() but this doesnt do it for me although it does look apparently reasonable. I suspect that the problem is to do with the Z depth of the new center of rotation Any pointers please THanks Alex =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". ========================= To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". ==========================================================================To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
<<attachment: pic.gif>>
