Does the Windows Composition API support 2.5D projected rotation?kivy 2.5d scene - graphics api with drawing/uix apiChange animation speed after it is startedComposition animation on a visual sub channelRotate soft on screen buttons on windows phone UWPUWP mail API - from non-UWP project (but desktop-bridge)using Composition API to draw objects on XAML Canvas with C++ UWP applicationDoes UWP Composition Api support color replacement?Storyboard Animation of UIElement.PlaneProjection Broken When Composition API Used at AllHow to make backside of Windows Composition UI ElementVisual different from front when rotated?Offset values for Windows Composition Visual not getting correctly initialized
What exact color does ozone gas have?
Temporarily disable WLAN internet access for children, but allow it for adults
Multiplicative persistence
Do the primes contain an infinite almost arithmetic progression?
What if a revenant (monster) gains fire resistance?
Recommended PCB layout understanding - ADM2572 datasheet
Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?
Is there a way to get `mathscr' with lower case letters in pdfLaTeX?
Why is so much work done on numerical verification of the Riemann Hypothesis?
Has any country ever had 2 former presidents in jail simultaneously?
Yosemite Fire Rings - What to Expect?
Why is this estimator biased?
Limits and Infinite Integration by Parts
Can I say "fingers" when referring to toes?
Calculating total slots
Can disgust be a key component of horror?
Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?
Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?
Using substitution ciphers to generate new alphabets in a novel
Angel of Condemnation - Exile creature with second ability
Biological Blimps: Propulsion
Fear of getting stuck on one programming language / technology that is not used in my country
Extract more than nine arguments that occur periodically in a sentence to use in macros in order to typset
Why would a new[] expression ever invoke a destructor?
Does the Windows Composition API support 2.5D projected rotation?
kivy 2.5d scene - graphics api with drawing/uix apiChange animation speed after it is startedComposition animation on a visual sub channelRotate soft on screen buttons on windows phone UWPUWP mail API - from non-UWP project (but desktop-bridge)using Composition API to draw objects on XAML Canvas with C++ UWP applicationDoes UWP Composition Api support color replacement?Storyboard Animation of UIElement.PlaneProjection Broken When Composition API Used at AllHow to make backside of Windows Composition UI ElementVisual different from front when rotated?Offset values for Windows Composition Visual not getting correctly initialized
I have started to use the Windows Composition API in UWP applications to animate elements of the UI.
Visual elements expose RotationAngleInDegrees and RotationAngle properties as well as a RotationAxis property.
When I animate a rectangular object's RotationAngleInDegrees value around the Y axis, the rectangle rotates as I would expect but in a 2D application window, it does not appear to be displaying with a 2.5D projection.
Is there a way to get the 2.5D projection effect on rotations with the composition api?
animation uwp rotation windows-composition-api 2.5d
add a comment |
I have started to use the Windows Composition API in UWP applications to animate elements of the UI.
Visual elements expose RotationAngleInDegrees and RotationAngle properties as well as a RotationAxis property.
When I animate a rectangular object's RotationAngleInDegrees value around the Y axis, the rectangle rotates as I would expect but in a 2D application window, it does not appear to be displaying with a 2.5D projection.
Is there a way to get the 2.5D projection effect on rotations with the composition api?
animation uwp rotation windows-composition-api 2.5d
add a comment |
I have started to use the Windows Composition API in UWP applications to animate elements of the UI.
Visual elements expose RotationAngleInDegrees and RotationAngle properties as well as a RotationAxis property.
When I animate a rectangular object's RotationAngleInDegrees value around the Y axis, the rectangle rotates as I would expect but in a 2D application window, it does not appear to be displaying with a 2.5D projection.
Is there a way to get the 2.5D projection effect on rotations with the composition api?
animation uwp rotation windows-composition-api 2.5d
I have started to use the Windows Composition API in UWP applications to animate elements of the UI.
Visual elements expose RotationAngleInDegrees and RotationAngle properties as well as a RotationAxis property.
When I animate a rectangular object's RotationAngleInDegrees value around the Y axis, the rectangle rotates as I would expect but in a 2D application window, it does not appear to be displaying with a 2.5D projection.
Is there a way to get the 2.5D projection effect on rotations with the composition api?
animation uwp rotation windows-composition-api 2.5d
animation uwp rotation windows-composition-api 2.5d
asked Mar 6 at 1:52
HoloSheepHoloSheep
519
519
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
It depends to the effect that you want to have. There is a fluent design app sample on GitHub and here is the link. You will be able to download the demo from the store. And you can get some idea from depth samples. For example, flip to reveal shows a way to rotate a image card and you can find source code from here. For more details please check the sample and the demo.
In general, the animation is to rotate based on X axis:
rectanglevisual.RotationAxis = new System.Numerics.Vector3(1f, 0f, 0f);
And then use rotate animation to rotate based on RotationAngleInDegrees.
It is also possible for you to do this directly on XAML platform by using PlaneProjection from image control.
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
add a comment |
As the sample that @BarryWang pointed me to demonstrates it is necessary to apply a TransformMatrix to the page (or a parenting container) before executing the animation to get the 2.5D effect with rotation or other spatial transformation animations with the composition api.
private void UpdatePerspective()
Visual visual = ElementCompositionPreview.GetElementVisual(MainPanel);
// Get the size of the area we are enabling perspective for
Vector2 sizeList = new Vector2((float)MainPanel.ActualWidth, (float)MainPanel.ActualHeight);
// Setup the perspective transform.
Matrix4x4 perspective = new Matrix4x4(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, -1.0f / sizeList.X,
0.0f, 0.0f, 0.0f, 1.0f);
// Set the parent transform to apply perspective to all children
visual.TransformMatrix =
Matrix4x4.CreateTranslation(-sizeList.X / 2, -sizeList.Y / 2, 0f) * // Translate to origin
perspective * // Apply perspective at origin
Matrix4x4.CreateTranslation(sizeList.X / 2, sizeList.Y / 2, 0f); // Translate back to original position
1
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55014325%2fdoes-the-windows-composition-api-support-2-5d-projected-rotation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It depends to the effect that you want to have. There is a fluent design app sample on GitHub and here is the link. You will be able to download the demo from the store. And you can get some idea from depth samples. For example, flip to reveal shows a way to rotate a image card and you can find source code from here. For more details please check the sample and the demo.
In general, the animation is to rotate based on X axis:
rectanglevisual.RotationAxis = new System.Numerics.Vector3(1f, 0f, 0f);
And then use rotate animation to rotate based on RotationAngleInDegrees.
It is also possible for you to do this directly on XAML platform by using PlaneProjection from image control.
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
add a comment |
It depends to the effect that you want to have. There is a fluent design app sample on GitHub and here is the link. You will be able to download the demo from the store. And you can get some idea from depth samples. For example, flip to reveal shows a way to rotate a image card and you can find source code from here. For more details please check the sample and the demo.
In general, the animation is to rotate based on X axis:
rectanglevisual.RotationAxis = new System.Numerics.Vector3(1f, 0f, 0f);
And then use rotate animation to rotate based on RotationAngleInDegrees.
It is also possible for you to do this directly on XAML platform by using PlaneProjection from image control.
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
add a comment |
It depends to the effect that you want to have. There is a fluent design app sample on GitHub and here is the link. You will be able to download the demo from the store. And you can get some idea from depth samples. For example, flip to reveal shows a way to rotate a image card and you can find source code from here. For more details please check the sample and the demo.
In general, the animation is to rotate based on X axis:
rectanglevisual.RotationAxis = new System.Numerics.Vector3(1f, 0f, 0f);
And then use rotate animation to rotate based on RotationAngleInDegrees.
It is also possible for you to do this directly on XAML platform by using PlaneProjection from image control.
It depends to the effect that you want to have. There is a fluent design app sample on GitHub and here is the link. You will be able to download the demo from the store. And you can get some idea from depth samples. For example, flip to reveal shows a way to rotate a image card and you can find source code from here. For more details please check the sample and the demo.
In general, the animation is to rotate based on X axis:
rectanglevisual.RotationAxis = new System.Numerics.Vector3(1f, 0f, 0f);
And then use rotate animation to rotate based on RotationAngleInDegrees.
It is also possible for you to do this directly on XAML platform by using PlaneProjection from image control.
edited Mar 8 at 2:23
answered Mar 6 at 8:02
Barry Wang - MSFTBarry Wang - MSFT
8871312
8871312
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
add a comment |
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
Thanks @BarryWang for pointing me to a sample. I was already using an animation based on RotationAngleInDegrees to rotate a card around the Y axis. However by default that rotation does not apply a perspective projection. The secrete seems to be that for the 2.5D projection effect you also need to apply a TransformMatrix to the page.
– HoloSheep
Mar 7 at 19:50
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
@HoloSheep Exactly. If that effect is what you want, the TransformMatrix is actually the answer.
– Barry Wang - MSFT
Mar 8 at 2:13
add a comment |
As the sample that @BarryWang pointed me to demonstrates it is necessary to apply a TransformMatrix to the page (or a parenting container) before executing the animation to get the 2.5D effect with rotation or other spatial transformation animations with the composition api.
private void UpdatePerspective()
Visual visual = ElementCompositionPreview.GetElementVisual(MainPanel);
// Get the size of the area we are enabling perspective for
Vector2 sizeList = new Vector2((float)MainPanel.ActualWidth, (float)MainPanel.ActualHeight);
// Setup the perspective transform.
Matrix4x4 perspective = new Matrix4x4(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, -1.0f / sizeList.X,
0.0f, 0.0f, 0.0f, 1.0f);
// Set the parent transform to apply perspective to all children
visual.TransformMatrix =
Matrix4x4.CreateTranslation(-sizeList.X / 2, -sizeList.Y / 2, 0f) * // Translate to origin
perspective * // Apply perspective at origin
Matrix4x4.CreateTranslation(sizeList.X / 2, sizeList.Y / 2, 0f); // Translate back to original position
1
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
add a comment |
As the sample that @BarryWang pointed me to demonstrates it is necessary to apply a TransformMatrix to the page (or a parenting container) before executing the animation to get the 2.5D effect with rotation or other spatial transformation animations with the composition api.
private void UpdatePerspective()
Visual visual = ElementCompositionPreview.GetElementVisual(MainPanel);
// Get the size of the area we are enabling perspective for
Vector2 sizeList = new Vector2((float)MainPanel.ActualWidth, (float)MainPanel.ActualHeight);
// Setup the perspective transform.
Matrix4x4 perspective = new Matrix4x4(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, -1.0f / sizeList.X,
0.0f, 0.0f, 0.0f, 1.0f);
// Set the parent transform to apply perspective to all children
visual.TransformMatrix =
Matrix4x4.CreateTranslation(-sizeList.X / 2, -sizeList.Y / 2, 0f) * // Translate to origin
perspective * // Apply perspective at origin
Matrix4x4.CreateTranslation(sizeList.X / 2, sizeList.Y / 2, 0f); // Translate back to original position
1
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
add a comment |
As the sample that @BarryWang pointed me to demonstrates it is necessary to apply a TransformMatrix to the page (or a parenting container) before executing the animation to get the 2.5D effect with rotation or other spatial transformation animations with the composition api.
private void UpdatePerspective()
Visual visual = ElementCompositionPreview.GetElementVisual(MainPanel);
// Get the size of the area we are enabling perspective for
Vector2 sizeList = new Vector2((float)MainPanel.ActualWidth, (float)MainPanel.ActualHeight);
// Setup the perspective transform.
Matrix4x4 perspective = new Matrix4x4(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, -1.0f / sizeList.X,
0.0f, 0.0f, 0.0f, 1.0f);
// Set the parent transform to apply perspective to all children
visual.TransformMatrix =
Matrix4x4.CreateTranslation(-sizeList.X / 2, -sizeList.Y / 2, 0f) * // Translate to origin
perspective * // Apply perspective at origin
Matrix4x4.CreateTranslation(sizeList.X / 2, sizeList.Y / 2, 0f); // Translate back to original position
As the sample that @BarryWang pointed me to demonstrates it is necessary to apply a TransformMatrix to the page (or a parenting container) before executing the animation to get the 2.5D effect with rotation or other spatial transformation animations with the composition api.
private void UpdatePerspective()
Visual visual = ElementCompositionPreview.GetElementVisual(MainPanel);
// Get the size of the area we are enabling perspective for
Vector2 sizeList = new Vector2((float)MainPanel.ActualWidth, (float)MainPanel.ActualHeight);
// Setup the perspective transform.
Matrix4x4 perspective = new Matrix4x4(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, -1.0f / sizeList.X,
0.0f, 0.0f, 0.0f, 1.0f);
// Set the parent transform to apply perspective to all children
visual.TransformMatrix =
Matrix4x4.CreateTranslation(-sizeList.X / 2, -sizeList.Y / 2, 0f) * // Translate to origin
perspective * // Apply perspective at origin
Matrix4x4.CreateTranslation(sizeList.X / 2, sizeList.Y / 2, 0f); // Translate back to original position
answered Mar 7 at 19:56
HoloSheepHoloSheep
519
519
1
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
add a comment |
1
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
1
1
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
You should also be able to do this using XAML's PerspectiveTransform3D property ` <Grid x:Name="RootGrid" > <Grid.Transform3D> <PerspectiveTransform3D Depth="1000" /> </Grid.Transform3D> .... </Grid> `
– Johnny Westlake
Mar 7 at 22:08
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
@JohnnyWestlake, awesome, I didn't realize that was in Windows 10 XAML or that it also worked in conjunction with the Composition APIs.
– HoloSheep
Mar 8 at 0:24
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55014325%2fdoes-the-windows-composition-api-support-2-5d-projected-rotation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown