0% found this document useful (0 votes)
2 views

cubo

The document describes a XAML layout containing a Canvas with a TextBox for inputting degrees and a 3D viewport. The viewport includes a perspective camera and multiple directional lights, along with a 3D geometry model that is animated to rotate based on the TextBox input. The geometry model is styled with a cyan color and a specific opacity.

Uploaded by

pahello bermudez
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

cubo

The document describes a XAML layout containing a Canvas with a TextBox for inputting degrees and a 3D viewport. The viewport includes a perspective camera and multiple directional lights, along with a 3D geometry model that is animated to rotate based on the TextBox input. The geometry model is styled with a cyan color and a specific opacity.

Uploaded by

pahello bermudez
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<Canvas Margin="32,26,94,40">

<TextBox x:Name="grados" Canvas.Left="438" Canvas.Top="287" Height="48"


Width="98" InputScope="Number" IsManipulationEnabled="True" AcceptsReturn="True"
HorizontalAlignment="Left" VerticalAlignment="Top" Background="#FF16CC21"
FontSize="36" Text=""/>
<Viewport3D Name="puerto" ClipToBounds="True" Width="150" Height="150"
Canvas.Left="262" HorizontalAlignment="Left" Canvas.Top="117"
VerticalAlignment="Top">
<Viewport3D.Camera>
<PerspectiveCamera x:Name="myPerspectiveCamera" Position="0,0,2"
LookDirection="0,0,-1"
FieldOfView="60" />
</Viewport3D.Camera>
<Viewport3D.Children>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="#FFFFFF" Direction="-0.612372,-
0.5,-0.612372" />
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="#FFFFFF" Direction="0.612372,-
0.5,-0.612372" />
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D TriangleIndices="0,1,2 3,4,5 "
Normals="0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 "
TextureCoordinates="0,0 1,0 1,1 1,1 0,1 0,0 "
Positions="-0.5,-0.5,0.5 0.5,-0.5,0.5
0.5,0.5,0.5 0.5,0.5,0.5 -0.5,0.5,0.5 -0.5,-0.5,0.5 " />
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial>
<DiffuseMaterial.Brush>
<SolidColorBrush Color="Cyan"
Opacity="0.3"/>
</DiffuseMaterial.Brush>
</DiffuseMaterial>

</GeometryModel3D.Material>
<!-- La propiedad Rotation del objeto esta animada para
causar la rotación del mismo -->
<GeometryModel3D.Transform>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D
x:Name="myAngleRotation" Axis="0,3,0" Angle= "{Binding ElementName=grados,
Path=Text, Mode=OneWay}"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>

</GeometryModel3D.Transform>
</GeometryModel3D>
</ModelVisual3D.Content>

</ModelVisual3D>
</Viewport3D.Children>

</Viewport3D>
</Canvas>

You might also like