Category: windows metro apps csharpvb
Helin Wang on Mon, 14 Jan 2013 20:23:51
<Grid Width="300" Height="200" x:Name="body" Background="AliceBlue"> <Grid.Projection> <PlaneProjection CenterOfRotationY="1" RotationX="-90" RotationY="0" RotationZ="0" /> </Grid.Projection> </Grid>
I rotated 90 degree along it's bottom, I was expecting to get a "line", but I got something seems like looking from top at a 90 degree rotated grid, it's not a line anymore.
I tried to change PlaneProjection's other properties, they does not seem to be relevant.
Is there a way to PlaneProjection rotate 90 degree on a grid along it's bottom while getting a line?Btw, I want to make animation that grid start from a "line" (rotated 90 degree on X-axis), rotate back to 0 degree on X-axis. The animation is a fake 3d page flip effect.
smsilva on Mon, 14 Jan 2013 22:15:01
i did not understand what are you doing.... do you want a line only? (because you base a Line control....)
Helin Wang on Mon, 14 Jan 2013 23:58:24
Sorry for the confusion. But I have stated, I want a grid rotated 90 degree on X-axis along it's bottom.
If you want to know why I want to do this: I want to make animation that grid start from a "line" (rotated 90 degree on X-axis), rotate back to 0 degree on X-axis.
smsilva on Tue, 15 Jan 2013 00:02:46
i think you should use RotateTransform class
Helin Wang on Tue, 15 Jan 2013 00:14:07
Sorry I haven't state I want a fake 3d effect. What your example provide is only 2d linear transformation which can not give a 3d effect.
Rob Caplan [MSFT] on Tue, 15 Jan 2013 00:24:18
The angle you see this at is caused by the CenterOfRotation="1" property. This tells the projection to tilt from the bottom so you are looking down on it from above. If you set it to "0" then it will tilt from the top so you look up at it from below. Set it to ".5" and it will tilt from the middle and you'll get your line.
Helin Wang on Tue, 15 Jan 2013 00:40:07
I want it tilt from bottom. But still see it as a line. Is it possible?
Rob Caplan [MSFT] on Tue, 15 Jan 2013 01:49:13
You can't change the eye-point, so you'll need to tilt it past 90 degrees to compensate for the difference. Exactly how far will depend on the size and shape of your grid.
Helin Wang on Tue, 15 Jan 2013 03:06:41
Thanks for the reply, tilt more is not a good option for me because it turns out tilt more will make the line wider than original width. It's sad there is no way to change eye-point.
I solved it by make it invisible before animation begin, so user will notice it.