The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

shekerka (5) [Avatar] Offline
#1
Hi everyone,

I am trying to use combine () method of the Bounds class.
I have shape3D that will move. I need to calculate area that is equal to the size of my shape and distance I am moving it to. I don't know what would be better to use some method of the transform or combine method of the bounds class?

this is how I calculate current bounds of the object
BoundingBox currBounds= new BoundingBox();
currBounds=shape.getBounds();
currBounds.transform(currXform);

and I used combine method as follows:
expandedBounds.combine(currBounds)

and it does not work. expanded Bounds remain the same

Can someone help me with this combine method or suggest another solution to my problem?

Thanks!
dselman (104) [Avatar] Offline
#2
Re: combine methods of the Bounds class
Where is currXform coming from? Maybe it is identity?

Dan
shekerka (5) [Avatar] Offline
#3
Re: combine methods of the Bounds class
Nope.
it is transform3d object taken from transformgroup I am operating on.
basically current transform of the transform group that is used to move the object
dselman (104) [Avatar] Offline
#4
Re: combine methods of the Bounds class
I think you will have to post more code to get to the bottom of this. Perhaps you have an error or misunderstanding in how Bounds relate to the coordinate system?

For example:
http://forum.java.sun.com/thread.jspa?threadID=349126&messageID=1446711

Dan
shekerka (5) [Avatar] Offline
#5
Re: combine methods of the Bounds class
yeah, I don't know what the problem was.
anyways I gave up on that idea.
my goal was to calculate bounds of where my object should eventually end up after I move it.
So I calculated transform of future location of my object and calculated bounds of my objects using future transform. I just don't have code with me to show. but It worked!
now I am struggling with 3D polygon triangulation. Basically collision detection.
overall project is collision avoidance. I coded the big thing. now I am struggling with the details.
unfortunately, I could not find any simple explanataions of the triangulation algorithms.