Hello David!
Thanks for your reply. If I use bounds( your code) to
calculate center of two primitives then there is one
problem.
Like if I take two SIMILAR shape3D objects and give
them different translation and rotation before finding
there centers using bounds, there centers are same.
Why its like that, when considering both of them have
different orientation in space.
But if I take two different primitives then their
centers using bounds were different.
Could you please explain me about this.
Thanks
--- David Yazel <[EMAIL PROTECTED]> wrote:
> If you are using primatives then perhaps the easiest
> thing is instead of
> using center of mass (which is not easy to
> calculate) is to get the bounds
> of the shape and then get the center.
>
> Bounds b = shape.getBounds();
> if (b instance of BoundingSphere) {
> Point3d center = new Point3d();
> ((BoundingSphere)b).getCenter(center);
> }
>
> ----- Original Message -----
> From: Ashish Aggarwal <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 18, 2001 8:47 PM
> Subject: Re: [JAVA3D] Plz help!
>
>
> HI David!
>
> thanks very much for ur reply. Could u please inform
> me abt the methods that I have to use. I was not
> able
> to find any method to find center of mass of the
> java
> primitives. Is there any example code available for
> this? please advice me.
>
> thanks
>
>
> --- David Yazel <[EMAIL PROTECTED]> wrote:
> > I love these requests :) I always feel like I am
> > doing someone's homework!
> >
> > hehe
> >
> > Anyway, more information is needed for a good
> > answer. But try this:
> >
> > 1. Calculate the center of mass for both objects.
> > 2. Cast a ray from one center of mass to the
> other,
> > using the line segment
> > pick type.
> > 3. Get the ray intersections on the skins of both
> > primitives. This will
> > give you a perfect tuple location on the
> > intersections.
> > 4. Draw a line from the skin on one object to the
> > skin on the other.
> >
> > Dave Yazel
> >
> > ----- Original Message -----
> > From: Ashish Aggarwal <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 18, 2001 4:02 PM
> > Subject: [JAVA3D] Plz help!
> >
> >
> > Hello!
> >
> > Can some body inform me about the following:
> >
> > Actually, I have multiple 3D primitives in the
> > window
> > like cone, cylinder, cube, sphere etc. How can I
> > connect these 3D shapes through lines? That is,
> how
> > can i draw lines dynamically among various shapes.
> > Suppose i first click on a sphere and then on a
> > cylinder, user should be able to draw a line
> between
> > the two shapes.
> >
> > This is really important. Please help me on this.
> >
> >
> > Thanks
> >
> >
> >
> >
> >
> >
> > =====
> > Graduate Research Assistant
> > Virtual/Augmented and Rapid Prototyping Lab
> > University of Missouri-Rolla
> > Rolla, MO 65401
> > 573-341-6815 (O)/573-308-1380 (R)
> > FAX: 573-341-6815
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Spot the hottest trends in music, movies, and
> more.
> > http://buzz.yahoo.com/
> >
> >
>
===========================================================================
> > 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".
>
>
> =====
> Graduate Research Assistant
> Virtual/Augmented and Rapid Prototyping Lab
> University of Missouri-Rolla
> Rolla, MO 65401
> 573-341-6815 (O)/573-308-1380 (R)
> FAX: 573-341-6815
>
> __________________________________________________
> Do You Yahoo!?
> Spot the hottest trends in music, movies, and more.
> http://buzz.yahoo.com/
>
>
===========================================================================
> 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".
=====
Graduate Research Assistant
Virtual/Augmented and Rapid Prototyping Lab
University of Missouri-Rolla
Rolla, MO 65401
573-341-6815 (O)/573-308-1380 (R)
FAX: 573-341-6815
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
===========================================================================
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".