Rotation about x, y and z-axis from xy, yz and xz plane

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I want to do a rotation of a point on xy, yz and xz plane. I am first doing it for a point on xy plane.
After counter clock-wise rotation of point on xy plane about x-axis, the point will move to xz plane.

rotate about x-axis xy plane2.png



After clock-wise rotation of point on xy plane about y-axis, the point will move to yz plane.
rotate about y-axis xy plane.png
After clock-wise rotation of point on xy plane about z-axis, the point will align with x-axis and after counter clock-wise rotation of point on xy plane about z-axis, the point will align with y-axis.

rotate about z-axis xy plane2.png

The angle of rotation is not necessarily 90 degrees. Some body please guide me whether my results are correct or not.

Zulfi.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,062
If the angle of rotation is not necessarily 90°, then how can a point in one of the cardinal planes end up on another cardinal plane?

When you say "counter clockwise", you mean counter clockwise from who's perspective?
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
Thanks for your response. I like your Qs:
If the angle of rotation is not necessarily 90°, then how can a point in one of the cardinal planes end up on another cardinal plane?
Perhaps we might be doing a 360 degree rotation and we would stop once we land on xz plane. Book does not say that the angle is 90 degrees. I have attached the figure. They have used angle ∝. I would quote what the book says but it uses a vector instead of a point.
Now we need the transformation that will put the rotation axis on the z-axis. We can use coordinate-axis rotations to accomplish this alignment in two steps. There are a number of ways to perform the two steps. We will first rotate about x-axis to transform vector u into the xz plane. Then we will swing u around to the z-axis using a y-axis rotation.
rotation of unit vector about the x-axis.png


When you say "counter clockwise", you mean counter clockwise from who's perspective?
Please tell me from the same perspective which the book is doing. I want to understand book's concept. Please guide me how to find the angle ∝.

Zulfi.
 
Last edited:

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I forgot to upload one image:
rotatation of unit vector around the x axis.png
I cant understand how to find out the sine and cosine values for this rotation. First they rotated about x-axis to bring the vector u in the xz plane.

For this they have shown:



cos alpha = u'. uz/ |u'| |uz| = c/d


I cant understand how they got c/d. They have defined unit vector u as:


u = V/ |V| = (a, b, c)


In a figure's description they say:


Rotation of u around the x-axis into the xz plane is accomplished by rotating u' through angle alpha onto the z-axis.

Even i cant understand the above statement.

Somebody please guide me.

Zulfi.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,062
Hi,
Thanks for your response. I like your Qs:

Perhaps we might be doing a 360 degree rotation and we would stop once we land on xz plane. Book does not say that the angle is 90 degrees. I have attached the figure. They have used angle ∝. I would quote what the book says but it uses a vector instead of a point.


Please tell me from the same perspective which the book is doing. I want to understand book's concept. Please guide me how to find the angle ∝.

Zulfi.
If they use a 360° rotation, then they would end up right back where they started.

How can I tell you what the perspective of the book is? It's YOUR book! I'm not a mind reader. YOU have to tell US what the perspective of YOUR book is.
 

MrAl

Joined Jun 17, 2014
11,486
Hi,

If you can show more scans of your actual book, somebody here can probably help you much better. Dont be a afraid to take a few more scans, as long as you dont scan an entire chapter or something. Make sure the equations can be read and the text is large enough to read easily.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi my friend,
Thanks for your reply. I appreciate your strategy and your willingness to help me in understanding266.png 267_1.png 267_2.png 268_1.png 268_2.png 269_1.png 270_1.png 271_1.png this troublesome topic. Right now i dont have access to scanner. I have got internet version of the book. But i dont know if its readable to you or not. So i am uploading it. If its not suitable to you, please tell me i would upload scanned pages tomorrow.

Zulfi.
 

Attachments

MrAl

Joined Jun 17, 2014
11,486
Hi again,

Ok, wow lots of pages :)

I noticed there is a page 272_2 but no 272_1, is that missing or just that 272_2 is the only part of that page?

What part are you getting stuck at?
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I am able to understand page 266 (the heading page), page 267, page 268. My trouble starts from page 269 after the translation matrix. I cant understand how to determine cos and sin values and the associated matrices for rotation around x-axis and about y-axis. I am providing you the book link also:
https://books.google.com.pk/books?id=4D9IqeflmswC&lpg=PA269&ots=9SJGkxLhzL&dq="Rotation of u around the x axis"&pg=PA267#v=onepage&q="Rotation of u around the x axis"&f=false

I would also do the scanning today. I understand you have to read from beginning otherwise you wont get background information. But my problem concentrates mainly on sine and cosine values. I would show you the summary of my problem:
step2 rotationabout x-axis.png

3rd step rotation about y-axis.png

Above are two images. Please check them. They are not so dull (low intensity). Thanks for taking interest in my problem. I wish you a great and prosperous future.

Zulfi.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
433.jpg 434.jpg 435.jpg 436.jpg 437.jpg 438.jpg

Hi,
Thanks for giving time to my problem. I have uploaded the scanned images of my book pages. But this is different edition so page numbers are different but contents and pictures are same. Note last page i.e. 439 is not required, so you can leave the last matrix in the previous upload also. Altogether there are seven steps:
A.Translate the point (x1,y1,z1) and (x2,y2,z2) to the original.
B.Rotate about the X-axis until the rotation axis is the x,z plane.
C.Rotation about Y-axis until the rotation axis corresponds to the z-axis.
D.Rotation about the z-axis angle .
E.Perform the inverse rotation of the step c.
F.Perform the inverse rotation of the step B.
G.Perform the inverse rotation of the step A.

I am not able to understand steps B & C (i.e. step 2 & 3) above. In these steps, how to find out cosine & sine values in terms of a, b, c, & d. I cant understand what is need for the Unit vector. How to obtain the projection of rotation access in yz plane, although we are in xz plane (i.e. step B or step 2). Somebody please guide me.

Zulfi.
 

MrAl

Joined Jun 17, 2014
11,486
Hello again,

First lets start with page 269 your scan 269_1.
The notation for this book might be a little unusual, so that's what we have to address first.
Because of the way they wrote out the 'sin' type cross product it appears that they use the notation:'uz' which is really read:
"u sub z" or sometimes as u_z (we cant use subscripts in this forum i dont think unless we use a bitmap).
So the unit vector u in the direction of z in square bracket notation is [0,0,1], not [0,0,c].

I think that is the root of your problem in solving for the angles. Once the formula they give is used with that in mind you'll get the same result they did which is c/d for that one angle.

If this isnt clear i'll draw up a bitmap, but try that first and see if you can get it working correctly.
BTW again once you have the right angles, you should try a few points to make sure you did it right. This is always a good idea even if it looks simple.

At the moment this topic is probably more interesting for me than other readers here because i was recently updating my drawing program used for detailing pictures of real life subjects as well as technical drawings. My older program suffered from a little problem when i updated by graphics card to a "high end" type graphics card (note that is in quotes because it is now questionable). With the older graphics card it worked fine, with the new one it started to go nuts if you zoom in too much, so i had to start updating it to work an entirely different way (as to drawing objects). So you can see computer graphics is also interesting for me too. Right now i use more of an 'incremental' type method, but the calculation type methods you are looking at are better because there is no storage involved so it's basically simpler :)
One thing i have learned in the past is that i have to test and retest the program to make sure it continues to work before and after every operation. You dont know how many times it can look right but really isnt, so when you do a certain operation it doesnt work after that. My current problem (which i dont think is too hard to solve this time though) is that once the picture is cropped, the cropping tool cant track the new coordinates so it can not crop a second time. This comes partly from taking the simple incremental route, when if everything was always calculated it would probably have the right coord's already.

Also, does that book contain any information on 3d shading techniques? I had to resort to complicated 3d analytic geometry for my 3d drawing program because i didnt have any good books on the subject yet. All the books i have gotten in the past were on math, electrical circuits, and physics and engineering.
 
Last edited:

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
Thanks for your reply. I would try to concentrate more on what you said but i dont find any trouble in understanding uz where u= (a, b, c) . Thus uz = (0, 0, c). Any way yours notation uz = (0, 0, 1) also seems logical. For your ease, I am again telling you the things which are going over my head and which are clear to me:
Rotate about the x-axis so that the rotation axis lies in the xz plane .
The above is (clear to me).
Let U = (a, b, c) be the unit vector along the rotation axis
The unit vector is clear to me but I dont know why we need this unit vector?
and define d= sqrt (b2 + c2)
Its clear to me that d is the magnitude but why are we considering b & c only? we are in the xz plane. In my view d should be
d= sqrt (a2 + c2)

as the length of the projection onto yz plane. If d=0 then the rotation axis is along the x-axis and no additional rotation is necessary. Otherwise rotate the rotation axis so that it lies in the xz plane .
I understand that we are doing later part i.e. rotate the rotation axis so that it lies in the xz plane
The rotation angle to achieve this is the angle between the projection of rotation axis in the yz plane and the z-axis
I cant understand how we got the projection of rotation axis in yz plane and why we need to find the projection of rotation axis in the yz plane


About your shading problem, I would tell you "Computer Graphics
A Programming Approach" by Steven Harrington. It discusses some shading algorithms. And yes the book from which i provided you the scanned pages (i dont know if you saw them), it has chapter 14 devoted to "Illumination Models and Surface Rendering Methods". I thing you should use the link which i provided you earlier. You search this title and surely you would get many power point material and even YoU-tube material. Actually in our country youtube is banned.

Thanks for your help. I am not able to understand only step 2 & step 3. I would soon update you about my problem.

Zulfi.


 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I have derived the cosine and sine for angle ∝ value:
The notation for this book might be a little unusual, so that's what we have to address first.
Because of the way they wrote out the 'sin' type cross product it appears that they use the notation:'uz' which is really read:
"u sub z" or sometimes as u_z (we cant use subscripts in this forum i dont think unless we use a bitmap).
So the unit vector u in the direction of z in square bracket notation is [0,0,1], not [0,0,c].
upload_2015-3-30_23-10-25.png
upload_2015-3-30_23-10-39.png
upload_2015-3-30_23-10-57.png
upload_2015-3-30_23-11-9.png
Then




Cos ∝ = (0, b, c) . (0, 0, 1) / sqrt (b. b + c.c) . (0.0 + 0.0 + 1.1)

= c/ d
and sine ∝ is given by:
U’ x Uz=Ux |U’| |Uz| sin (Note : I am not able to figure out why there is Ux)

Also

U’ x Uz =Ux . b

Equating the right sides of the above equations:

Ux |U’| |Uz| sin = Ux . b

Ux would be eliminated from both sides, |U’|=d & |Uz|=1

d sin = b

sin = b/d

But again I cant understand the following statement from the book which is about angle :

This rotation angle is the angle between the projection of U in the yz and the positive z-axis.
My current problem (which i dont think is too hard to solve this time though) is that once the picture is cropped, the cropping tool cant track the new coordinates so it can not crop a second time.
Yes, you are right. This is a storage problem. This is more a programming problem. Over here programming is not given much importance. So i can do it personally when i have time which is difficult because things keep changing.
Thanks for your guidance. Please explain me the problems indicated above.

Zulfi.
 
Last edited:

MrAl

Joined Jun 17, 2014
11,486
Hi again,

They had shown Ux (which we are taking to mean u sub x again) like that i guess so as to point out the unit normal, to show what direction it is in, when usually this would be implied, not written out directly like that. So we'd see (for two arbitrary u and v):
|u|*|v|*sin(Theta) n_hat
So they are telling you the direction already with the notation Ux rather than making you figure it out from the other variables.
In this case we should have Ux=[1,0,0], and that must be because of y and z forming a plane.

Yeah i have to put some more effort into the program of mine i guess. It's about 95 percent done but still more to be done. It was a chore to go from the first program to the second because it was almost an entire rewrite. The first program did not have to worry about the size of the bitmap surface, while with the new graphics card, it wont accept bitmap surfaces over a certain size. This is very puzzling because it has much more memory built in (like 2GB compared to the old 500MB). I would have thought it could handle BIGGER bitmaps without the need to temporarily crop before display, which is what i have to do now.
 
Last edited:

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I am trying to find cos β. I am stuck at this point:

cos β = U” . Uz/ |U”| |Uz|

= (a, 0, d) . (0, 0, 1) / |(a, 0, d) | |(0, 0, 1)|

= d / sqrt (a2 + d2)

Somebody please guide me, what to do next?

Zulfi.
 

MrAl

Joined Jun 17, 2014
11,486
Hello again,

Recall that the norm of a unit vector is always 1. The unit vector is [a,b,c], and the norm is sqrt(a^2+b^2+c^2).
Now in the denominator we have to calculate the norm of [a,0,d] times the norm of [0,0,1], and the norm of [0,0,1] is just 1, so next we have to calculate the norm of [a,0,d].

Since d=sqrt(b^2+c^2), we need to calculate:
sqrt(a^2+0^2+(b^2+c^2))

and as you can see this is equal to:
sqrt(a^2+b^2+c^2)

which is the same as the norm of the original unit vector [a,b,c] so it must equal 1.

Thus in the denominator we get 1, and in the numerator we get d, so the final result is d, so we have:
cos(Beta)=d
 
Last edited:

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
Thanks for your help.
The unit vector is [a,b,c], and the norm is sqrt(a^2+b^2+c^2).
Indeed I knew this fact but it was beyond my thinking that i should apply it in that way to make the denominator 1. You have brought a great relieve to me. Though I am able to understand the two tough problems mathematically but still some problems are left. In addition to this i have to solve some related examples.

Thanks for your time. Wish you success in your problems too.

Zulfi.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi my friend,
I forgot to tell you. My book has following topics on shading:
i) Shadows
ii) Gouraud Shading
iii) Phong Shading
iv) Fast Phong Shading

If you need scanning of any one/all of these topics please let me. Are you looking for any specific topic??


Zulfi.
 

MrAl

Joined Jun 17, 2014
11,486
Hello again,

Oh thanks. What is the simplest possible 3d shading idea they give in the book, and is it one or two pages or a whole chapter?
 
Top