Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在3D透视图中对windows UI8元素进行Z索引(Z排序)?_C#_Windows 8_Z Index_Transform_Uielement - Fatal编程技术网

C# 如何在3D透视图中对windows UI8元素进行Z索引(Z排序)?

C# 如何在3D透视图中对windows UI8元素进行Z索引(Z排序)?,c#,windows-8,z-index,transform,uielement,C#,Windows 8,Z Index,Transform,Uielement,通常,您可以使用所谓的“透视变换”将三维效果(x、y、z、rotationX、rotationY、rotationZ…)应用于任何UIElement: 但是没有Z-索引(Z-排序)! 当元素重叠时,它们在透视图中无法正确渲染 在AS3中,我使用此函数对对象进行排序: public function zSort():void { var i:uint; var zList:Array = []; for (i=0; i<this.n

通常,您可以使用所谓的“透视变换”将三维效果(x、y、z、rotationX、rotationY、rotationZ…)应用于任何
UIElement


但是没有Z-索引(Z-排序)! 当元素重叠时,它们在透视图中无法正确渲染

在AS3中,我使用此函数对对象进行排序:

public function zSort():void
    {
        var i:uint;
        var zList:Array = [];
        for (i=0; i<this.numChildren; i++)
        {
            var mtx:Matrix3D = this.getChildAt(i).transform.getRelativeMatrix3D(this.parent);
            zList.push( { sp:this.getChildAt(i), z:mtx.position.z } );
        }
        zList.sortOn("z", Array.NUMERIC | Array.DESCENDING);
        for (i=0; i<this.numChildren; i++)
        {
            this.setChildIndex(zList[i].sp, i);
        }
    }
公共函数zSort():void
{
变量i:uint;
var zList:Array=[];

对于(i=0;i如果您将
图像
放置在a中,您将能够设置。

如果您将
图像
放置在a中,您将能够设置。

但是如何在透视图中对其进行zindex?就像三维旋转木马或旋转立方体中的图像一样?但是如何在透视图中对其进行zindex?就像三维旋转木马或旋转立方体中的图像一样?
public function zSort():void
    {
        var i:uint;
        var zList:Array = [];
        for (i=0; i<this.numChildren; i++)
        {
            var mtx:Matrix3D = this.getChildAt(i).transform.getRelativeMatrix3D(this.parent);
            zList.push( { sp:this.getChildAt(i), z:mtx.position.z } );
        }
        zList.sortOn("z", Array.NUMERIC | Array.DESCENDING);
        for (i=0; i<this.numChildren; i++)
        {
            this.setChildIndex(zList[i].sp, i);
        }
    }