Click here to Skip to main content
15,885,216 members
Articles / Mobile Apps / Windows Phone 7

Augmented reality - XNA Models

Rate me:
Please Sign up or sign in to vote.
5.00/5 (8 votes)
23 Aug 2012CPOL8 min read 44.7K   916   24  
Geocoordinate positioned Xna model viewable thru Photocamera
#region File Description
//-----------------------------------------------------------------------------
// VertexPositionNormal.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace Primitives3D
{
    /// <summary>
    /// Custom vertex type for vertices that have just a
    /// position and a normal, without any texture coordinates.
    /// </summary>
    public struct VertexPositionNormal : IVertexType
    {
        public Vector3 Position;
        public Vector3 Normal;


        /// <summary>
        /// Constructor.
        /// </summary>
        public VertexPositionNormal(Vector3 position, Vector3 normal)
        {
            Position = position;
            Normal = normal;
        }

        /// <summary>
        /// A VertexDeclaration object, which contains information about the vertex
        /// elements contained within this struct.
        /// </summary>
        public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration
        (
            new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
            new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0)
        );

        VertexDeclaration IVertexType.VertexDeclaration
        {
            get { return VertexPositionNormal.VertexDeclaration; }
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) EVRY
Norway Norway
Started programming on the mainframe in 1985.
Have been programming in Visual Basic since VB 2.0
and been using Visual Studio since it appeared on the market.
Currently prefered language when working with Windows Phone is C#.
For the time being main interest is "Augmented Reality" types of apps..
I am employed at EVRY a Norwegian based very successful DP company with offices in Norway, Sweden, Denmark, Finland, U.K., India and Ukraine.

Comments and Discussions