From: Roger Stafford on
"Marcin " <mb1234(a)gazeta.pl> wrote in message <ht3go0$6hi$1(a)fred.mathworks.com>...
> "Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <ht1pm2$1v$1(a)fred.mathworks.com>...
> > "Marcin " <mb1234(a)gazeta.pl> wrote in message <hsvvv6$7rl$1(a)fred.mathworks.com>...
> > > Hi,
> > >
> > > I have a set of points describing a 3D object, which has been rotated by some small angle (below 45 degrees) with respect to x,y and z axis. I want to rotate it back to align it with the x-y plane, but the problem is I don't know the angles, so I need to calculate/estimate them somehow. So the questions are:
> > >
> > > 1. how to plot the object in a mesh like manner?
> > > 2. how to calculate the angles?
> > > 3. how to rotate it when I know the angles?
> > >
> > > Many thanks
> >
> > I am not clear about what you mean when you say, "I want to rotate it back to align it with the x-y plane." Do the set of points "describing" the 3D object all lie in a plane? If so, there are many ways to rotate them so they all come to lie in the x-y plane. Any rotation axis which lies in the plane which bisects the dihedral angle between the points' plane and the x-y plane could be used. You can achieve any orientation you wish for the resulting x-y plane points. If you have a preferred final orientation for the points as they lie in the x-y plane, then I could give you a specific method for solving your problem. As it stands, the problem appears to be indeterminate if I have understood you correctly.
> >
> > Roger Stafford
>
> Hi Roger,
>
> Thanks for replying. I'll try to be more precise. I have a set of coordinates in 3 dimensions (xyz triplets), which describe some object. Due to the way the coordinates have been recorded, the object might be rotated, so that it's position is not say horizontal. I need to rotate it back, but first I need to detect the angle by which to rotate.
>
> Also, is there a nice way to plot the object in MATLAB? Is it possible to interpolate or convert the data somehow to use the patch function or surf maybe?
>
> Thanks

You must face facts, Marcin! What you are asking for, you simply cannot accomplish without more information to go on. You state that you have a set of points which "describe" a three-dimensional object, but how is anyone to tell how these points were originally oriented in space when the object was, as you say, "horizontal"? Even if the points are known to have been originally lying in a horizontal plane, (which would mean that the points are also currently colinear) that still isn't enough information to determine what rotation has been performed. Infinitely many are still possible as I have already pointed out to you at some length.

Roger Stafford
From: Marcin on
> You must face facts, Marcin! What you are asking for, you simply cannot accomplish without more information to go on. You state that you have a set of points which "describe" a three-dimensional object, but how is anyone to tell how these points were originally oriented in space when the object was, as you say, "horizontal"? Even if the points are known to have been originally lying in a horizontal plane, (which would mean that the points are also currently colinear) that still isn't enough information to determine what rotation has been performed. Infinitely many are still possible as I have already pointed out to you at some length.
>
> Roger Stafford

That's the catch. Nobody knows that, so it must be some kind of guess. I think that PCA might do in this case. Anyway, I still don't know how to plot it though. The data is an output of a 3D scan, so I should be able to use mesh/surf or similar function.
From: Matt J on
"Marcin " <mb1234(a)gazeta.pl> wrote in message <ht4940$b11$1(a)fred.mathworks.com>...

Anyway, I still don't know how to plot it though. The data is an output of a 3D scan, so I should be able to use mesh/surf or similar function.
===============

Well then why don't you use these? SURF seems like it should work fine.
From: Roger Stafford on
"Marcin " <mb1234(a)gazeta.pl> wrote in message <ht4940$b11$1(a)fred.mathworks.com>...
> That's the catch. Nobody knows that, so it must be some kind of guess.
- - - - - -
It is no guess, Marcin. What you have put forward is not a well-defined problem and certainly does not have a unique solution. In fact there are infinitely many solutions.

I strongly suggest you think long and hard about information concerning the object in its so-called "horizontal" position which you haven't thought to state here. Maybe there is something you know which will make it all a very reasonable problem. As it currently stands it is meaningless.

If I were to hand you a perfectly spherical ball and ask you to rotate it until it was horizontal, what would be your reply? Your probable response should indicate to you what kind of problem you have been presenting here to us. I am sure you can do better than that.

Roger Stafford
From: Marcin on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <ht4au4$7ua$1(a)fred.mathworks.com>...
> "Marcin " <mb1234(a)gazeta.pl> wrote in message <ht4940$b11$1(a)fred.mathworks.com>...
>
> Anyway, I still don't know how to plot it though. The data is an output of a 3D scan, so I should be able to use mesh/surf or similar function.
> ===============
>
> Well then why don't you use these? SURF seems like it should work fine.

Hi Matt,

Surf requires a matrix of function values (one function value for every pair of x-y) and I don't have this information - all I have are xyz triplets, but in general case each value of say x can occur only once...
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Pixel Scan
Next: Any reliabillity engineering geek?