About the rotation (orientation or rotation) in Fig)

Source: Internet
Author: User

About the rotation in Fig

1. Orientation of Viewpoint

Orientation X Y Z DETA
The first three values are coordinates (x, y, z), which are connected to (0, 0, 0,
Is a vector M pointing from (0, 0, 0) to (x, y, z), that is, it
Only direction, no position.
At the position point, take the vector m as the center axis and rotate the angle DETA to determine
The direction of this viewpoint is now.
If the value of DETA is greater than 0, the angle of view is converted counterclockwise;
DETA <0, the clockwise angle of view.

# Fig

Viewpoint
{
Position 0 0 20 # coordinates of the viewpoint
Orientation 0 1 0 0.78 # determine a positive y vector, turning 45 degrees counter-clockwise, watching the ball
# Orientation 0 1 0 0 # normal view, facing the square
# Orientation 0 1 0-0.78 # Turn right 45 degrees, view the cylinder
}

Transform # the ball on the negative axis of the Origin
{
Translation-10 0 0
Children
[
Shape
{
Appearance appearance {}# gray
Geometry sphere
{
Radius 1
}
}
]
}

Transform # square on the origin, green
{
Translation 0 0 0
Children
[
Shape
{
Appearance appearance
{
Material material
{
Diffusecolor 0 1 0
}
}
Geometry box
{
Size 2 2 2
}
}
]
}

Transform # the column on the X axis, blue
{
Translation 10 0 0
Children
[
Shape
{
Appearance appearance
{
Material material
{
Diffusecolor 0 0 1
}
}
Geometry Cylinder
{
Radius 1
Height 2
}
}
]
}

2. Rotation in the shape. Example: Transform
Rotation X Y Z DETA
The shape rotates the DETA radians around the (0, 0)-> (x, y, z) vector at its position.
DETA> 0, counterclockwise;
DETA <0, clockwise.

# Fig
Transform
{
Translation 8 0 0 # first translate, then rotaion.
Rotation 0 0 1-0.78 # view the left-leaning Column
# Rotation 0 0 1 0.78 # right tilt
Children
[
Shape
{
Appearance appearance
{
Material material
{
Diffusecolor 0 0 1
}
}
Geometry Cylinder
{
Radius 1
Height 2
}
}
]
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.