Solar Wind 3D Sample

This sample for Silverilght 5 uses the new 3D features to draw the Earth with day and night transitions, atmosphere layers, and population density overlays. It demonstrates advanced concepts like mipmaps, texture blending, multiple drawing passes, sampler states...

C# (10.4 MB)
 
 
 
 
 
4.4 Star
(8)
9,131 times
Add to favorites
9/12/2011
E-mail Twitter del.icio.us Digg Facebook
// ===================================================================================
//  Copyright (c) Microsoft Corporation.  All rights reserved.
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
//  OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
//  LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
//  FITNESS FOR A PARTICULAR PURPOSE.
// ===================================================================================
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SolarWind
{
    /// <summary>
    /// Simple class to emulate polling input semantics
    /// </summary>
    public class Keyboard
    {
        /// <summary>
        /// State of all keys
        /// </summary>
        static bool[] keyState = new bool[256];

        /// <summary>
        /// Determines whether a key is down or up
        /// </summary>
        /// <param name="key">The key to poll</param>
        /// <returns>True if the key is down</returns>
        public static bool IsKeyDown(Key key)
        {
            return keyState[(int)key];
        }

        /// <summary>
        /// Sets the state of a key
        /// </summary>
        /// <param name="key">The key to set state for</param>
        /// <param name="down">True if the key should be set to down</param>
        public static void SetKeyDown(Key key, bool down)
        {
            keyState[(int)key] = down;
        }
    }
}