[Rpgworldmodel-commits] SF.net SVN: rpgworldmodel: [10] src/test_applications/ItemsViewer
Status: Inactive
Brought to you by:
deadwood_pl
From: <pos...@us...> - 2006-07-06 13:53:44
|
Revision: 10 Author: poserdev Date: 2006-07-06 06:53:21 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/rpgworldmodel/?rev=10&view=rev Log Message: ----------- Big reorganization in the application structure. Enabling object rotation/scaling in progress. Home I make it right from now :) Modified Paths: -------------- src/test_applications/ItemsViewer/App.config src/test_applications/ItemsViewer/ItemsViewer.csproj src/test_applications/ItemsViewer/Program.cs src/test_applications/ItemsViewer/Properties/AssemblyInfo.cs Added Paths: ----------- src/test_applications/ItemsViewer/Form1.Designer.cs src/test_applications/ItemsViewer/Form1.cs src/test_applications/ItemsViewer/SceenObject.cs src/test_applications/ItemsViewer/SwordObject.cs Removed Paths: ------------- src/test_applications/ItemsViewer/IModel.cs src/test_applications/ItemsViewer/Model.cs src/test_applications/ItemsViewer/OpenModelDialog.Designer.cs src/test_applications/ItemsViewer/OpenModelDialog.cs src/test_applications/ItemsViewer/Surface.cs src/test_applications/ItemsViewer/ViewController.cs src/test_applications/ItemsViewer/ViewState.cs Modified: src/test_applications/ItemsViewer/App.config =================================================================== --- src/test_applications/ItemsViewer/App.config 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/App.config 2006-07-06 13:53:21 UTC (rev 10) @@ -1,11 +1,3 @@ <?xml version="1.0" encoding="utf-8" ?> - <configuration> - <configSections> - <section name="models" type="System.Configuration.NameValueSectionHandler" /> - </configSections> - - <models> - <add key="Long Iron Sword" value="Models\sword.x" /> - </models> </configuration> \ No newline at end of file Added: src/test_applications/ItemsViewer/Form1.Designer.cs =================================================================== --- src/test_applications/ItemsViewer/Form1.Designer.cs (rev 0) +++ src/test_applications/ItemsViewer/Form1.Designer.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -0,0 +1,49 @@ +namespace ItemsViewer +{ + partial class Form1 + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.SuspendLayout(); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 273); + this.MinimumSize = new System.Drawing.Size(100, 100); + this.Name = "Form1"; + this.Text = "Form1"; + this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); + this.ResumeLayout(false); + + } + + #endregion + } +} + Added: src/test_applications/ItemsViewer/Form1.cs =================================================================== --- src/test_applications/ItemsViewer/Form1.cs (rev 0) +++ src/test_applications/ItemsViewer/Form1.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using Microsoft.DirectX; +using Microsoft.DirectX.Direct3D; + +using ItemsViewer.SceenObjects; + +namespace ItemsViewer +{ + public partial class Form1 : Form + { + private Device m_Device; + private SwordObject m_SceenObject; + + public Form1() + { + InitializeComponent(); + this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); + + this.MouseWheel += new MouseEventHandler(Form1_MouseWheel); + + InitializeGraphics(); + } + + private void SetupCamera() + { + this.m_Device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4, + 1, 1, 100.0f); + this.m_Device.Transform.View = Matrix.LookAtLH(new Vector3(0, 0, 20), new Vector3(), + new Vector3(0, 1, 0)); + + this.m_Device.Transform.World = Matrix.RotationZ(Environment.TickCount / 1000.0f) * + Matrix.RotationY(Environment.TickCount / 1000.0f) * Matrix.Scaling(0.02f, 0.02f, 0.02f); + } + + private void InitializeGraphics() + { + PresentParameters parameters = new PresentParameters(); + parameters.Windowed = true; + parameters.SwapEffect = SwapEffect.Discard; + parameters.EnableAutoDepthStencil = true; + parameters.AutoDepthStencilFormat = DepthFormat.D16; + + this.m_Device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, parameters); + this.m_Device.RenderState.CullMode = Cull.None; + this.m_Device.RenderState.ZBufferEnable = true; + + this.m_SceenObject = new SwordObject(this.m_Device); + this.m_SceenObject.LoadMesh(@"Models\Base\Sword\sword.x"); + } + + private void Form1_Paint(object sender, PaintEventArgs e) + { + this.m_Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, System.Drawing.Color.CornflowerBlue, 1.0f, 0); + this.m_Device.RenderState.Ambient = Color.White; + + this.SetupCamera(); + + this.m_Device.BeginScene(); + + for (int i = 0; i < this.m_SceenObject.Materials.Length; i++) + { + this.m_Device.Material = this.m_SceenObject.Materials[i]; + this.m_Device.SetTexture(0, this.m_SceenObject.Textures[i]); + this.m_SceenObject.Mesh.DrawSubset(i); + } + + this.m_Device.EndScene(); + + this.m_Device.Present(); + this.Invalidate(); + } + + // Control over the sceen object zoom factor + void Form1_MouseWheel(object sender, MouseEventArgs e) + { + if (e.Delta > 0) + { + } + else + { + } + } + } +} \ No newline at end of file Deleted: src/test_applications/ItemsViewer/IModel.cs =================================================================== --- src/test_applications/ItemsViewer/IModel.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/IModel.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,24 +0,0 @@ -using System; - -using Microsoft.DirectX.Direct3D; - -namespace RPGWorldModel.ItemsViewer -{ - public interface IModel - { - Mesh Object - { - get; - } - - Material[] Materials - { - get; - } - - Texture[] Textures - { - get; - } - } -} Modified: src/test_applications/ItemsViewer/ItemsViewer.csproj =================================================================== --- src/test_applications/ItemsViewer/ItemsViewer.csproj 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/ItemsViewer.csproj 2006-07-06 13:53:21 UTC (rev 10) @@ -4,11 +4,11 @@ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{57684296-F942-4797-8C0F-ADB151A02477}</ProjectGuid> + <ProjectGuid>{CA0D68AD-69C4-46D2-B09B-036D02ABA061}</ProjectGuid> <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>RPGWorldModel.ItemsViewer</RootNamespace> - <AssemblyName>ModelViewer</AssemblyName> + <RootNamespace>ItemsViewer</RootNamespace> + <AssemblyName>ItemsViewer</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -28,43 +28,28 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <Private>False</Private> - </Reference> - <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <Private>False</Private> - </Reference> - <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <Private>False</Private> - </Reference> - <Reference Include="RPGWorldModel.Abstracts, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\RPGWorldModel.Abstracts\bin\Debug\RPGWorldModel.Abstracts.dll</HintPath> - </Reference> + <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <Reference Include="System" /> - <Reference Include="System.configuration" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="IModel.cs" /> - <Compile Include="Model.cs" /> - <Compile Include="OpenModelDialog.cs"> + <Compile Include="Form1.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="OpenModelDialog.Designer.cs"> - <DependentUpon>OpenModelDialog.cs</DependentUpon> + <Compile Include="Form1.Designer.cs"> + <DependentUpon>Form1.cs</DependentUpon> </Compile> - <Compile Include="Surface.cs"> - <SubType>Form</SubType> - </Compile> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="ViewController.cs" /> - <Compile Include="ViewState.cs" /> - </ItemGroup> - <ItemGroup> <None Include="App.config" /> + <Compile Include="SceenObject.cs" /> + <Compile Include="SwordObject.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Deleted: src/test_applications/ItemsViewer/Model.cs =================================================================== --- src/test_applications/ItemsViewer/Model.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/Model.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,69 +0,0 @@ -using System; -using System.IO; -using System.Windows.Forms; - -using Microsoft.DirectX; -using Microsoft.DirectX.Direct3D; - -namespace RPGWorldModel.ItemsViewer -{ - public class Model : IModel - { - private Mesh m_Object; - private Material[] m_Materials; - private Texture[] m_Textures; - - public Model(string source, Device device) - { - - - if (File.Exists(source)) - { - Directory.SetCurrentDirectory(Application.StartupPath + - Path.DirectorySeparatorChar + Path.GetDirectoryName(source)); - - // Load the model - ExtendedMaterial[] materials; - this.m_Object = Mesh.FromFile(System.IO.Path.GetFileName(source), MeshFlags.SystemMemory, device, out materials); - - this.m_Textures = new Texture[materials.Length]; - this.m_Materials = new Material[materials.Length]; - - for (int i = 0; i < materials.Length; i++) - { - this.m_Materials[i] = materials[i].Material3D; - this.m_Materials[i].Ambient = this.m_Materials[i].Diffuse; - this.m_Textures[i] = TextureLoader.FromFile(device, materials[i].TextureFilename); - } - } - } - - #region IModel Members - - public Mesh Object - { - get - { - return this.m_Object; - } - } - - public Material[] Materials - { - get - { - return this.m_Materials; - } - } - - public Texture[] Textures - { - get - { - return this.m_Textures; - } - } - - #endregion - } -} Deleted: src/test_applications/ItemsViewer/OpenModelDialog.Designer.cs =================================================================== --- src/test_applications/ItemsViewer/OpenModelDialog.Designer.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/OpenModelDialog.Designer.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,84 +0,0 @@ -namespace RPGWorldModel.ItemsViewer -{ - partial class OpenModelDialog - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.m_List = new System.Windows.Forms.ListBox(); - this.m_Picture = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.m_Picture)).BeginInit(); - this.SuspendLayout(); - // - // m_List - // - this.m_List.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.m_List.Dock = System.Windows.Forms.DockStyle.Left; - this.m_List.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.m_List.IntegralHeight = false; - this.m_List.ItemHeight = 20; - this.m_List.Location = new System.Drawing.Point(0, 0); - this.m_List.Margin = new System.Windows.Forms.Padding(0); - this.m_List.Name = "m_List"; - this.m_List.ScrollAlwaysVisible = true; - this.m_List.Size = new System.Drawing.Size(400, 168); - this.m_List.TabIndex = 0; - this.m_List.DoubleClick += new System.EventHandler(this.m_List_DoubleClick); - this.m_List.SelectedIndexChanged += new System.EventHandler(this.m_List_SelectedIndexChanged); - // - // m_Picture - // - this.m_Picture.Dock = System.Windows.Forms.DockStyle.Fill; - this.m_Picture.Location = new System.Drawing.Point(400, 0); - this.m_Picture.Name = "m_Picture"; - this.m_Picture.Size = new System.Drawing.Size(194, 168); - this.m_Picture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.m_Picture.TabIndex = 1; - this.m_Picture.TabStop = false; - // - // OpenModelDialog - // - this.AutoSize = true; - this.ClientSize = new System.Drawing.Size(594, 168); - this.Controls.Add(this.m_Picture); - this.Controls.Add(this.m_List); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "OpenModelDialog"; - this.ShowIcon = false; - this.Text = "Model"; - ((System.ComponentModel.ISupportInitialize)(this.m_Picture)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ListBox m_List; - private System.Windows.Forms.PictureBox m_Picture; - } -} \ No newline at end of file Deleted: src/test_applications/ItemsViewer/OpenModelDialog.cs =================================================================== --- src/test_applications/ItemsViewer/OpenModelDialog.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/OpenModelDialog.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,54 +0,0 @@ -using System; -using System.IO; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -namespace RPGWorldModel.ItemsViewer -{ - public partial class OpenModelDialog : Form - { - private string m_SelectedModel; - private NameValueCollection m_Models; - - public OpenModelDialog(NameValueCollection models) - { - InitializeComponent(); - - this.m_Models = models; - - foreach (string key in this.m_Models.AllKeys) - this.m_List.Items.Add(key); - - this.m_List.SelectedIndex = -1; - } - - private void m_List_SelectedIndexChanged(object sender, EventArgs e) - { - string file = this.m_Models[this.m_List.SelectedItem.ToString()]; - // Load the model image - this.m_Picture.Load(Path.GetDirectoryName(file) + Path.DirectorySeparatorChar + - Path.GetFileNameWithoutExtension(file) + @".bmp"); - } - - private void m_List_DoubleClick(object sender, EventArgs e) - { - if (this.m_List.SelectedItem != null) - { - this.m_SelectedModel = this.m_List.SelectedItem.ToString(); - - this.DialogResult = DialogResult.OK; - this.Close(); - } - } - - public string SelectedModel - { - get - { - return this.m_SelectedModel; - } - } - } -} \ No newline at end of file Modified: src/test_applications/ItemsViewer/Program.cs =================================================================== --- src/test_applications/ItemsViewer/Program.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/Program.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,13 +1,20 @@ using System; +using System.Collections.Generic; +using System.Windows.Forms; -namespace RPGWorldModel.ItemsViewer +namespace ItemsViewer { static class Program { + /// <summary> + /// The main entry point for the application. + /// </summary> [STAThread] static void Main() { - ViewController view = new ViewController(); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); } } } \ No newline at end of file Modified: src/test_applications/ItemsViewer/Properties/AssemblyInfo.cs =================================================================== --- src/test_applications/ItemsViewer/Properties/AssemblyInfo.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/Properties/AssemblyInfo.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -5,11 +5,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("ModelViewer")] +[assembly: AssemblyTitle("ItemsViewer")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ModelViewer")] +[assembly: AssemblyProduct("ItemsViewer")] [assembly: AssemblyCopyright("Copyright © 2006")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2526b583-4d40-451f-b223-b66498fedb85")] +[assembly: Guid("ddbe5d05-3a77-4fe1-b4b0-108222295195")] // Version information for an assembly consists of the following four values: // Added: src/test_applications/ItemsViewer/SceenObject.cs =================================================================== --- src/test_applications/ItemsViewer/SceenObject.cs (rev 0) +++ src/test_applications/ItemsViewer/SceenObject.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -0,0 +1,63 @@ +using System; +using System.IO; +using System.Drawing; +using System.Windows.Forms; + +using Microsoft.DirectX.Direct3D; + +namespace ItemsViewer.SceenObjects +{ + public class SceenObject + { + private Mesh m_Mesh; + private Material[] m_Materials; + private Texture[] m_Textures; + private Device m_Device; + + /// <summary> + /// Creates a new screen object + /// </summary> + public SceenObject(ref Device device) + { + this.m_Mesh = null; + this.m_Materials = null; + this.m_Textures = null; + this.m_Device = device; + } + + public virtual void LoadMesh(string source) + { + Directory.SetCurrentDirectory( + System.IO.Path.Combine(Application.StartupPath, System.IO.Path.GetDirectoryName(source))); + + ExtendedMaterial[] materials = null; + + this.m_Mesh = Mesh.FromFile(Path.GetFileName(source), MeshFlags.SystemMemory, this.m_Device, out materials); + + this.m_Textures = new Texture[materials.Length]; + this.m_Materials = new Material[materials.Length]; + + for (int i = 0; i < materials.Length; i++) + { + this.m_Materials[i] = materials[i].Material3D; + this.m_Materials[i].Ambient = this.m_Materials[i].Diffuse; + this.m_Textures[i] = TextureLoader.FromFile(this.m_Device, materials[i].TextureFilename); + } + } + + public Mesh Mesh + { + get { return this.m_Mesh; } + } + + public Texture[] Textures + { + get { return this.m_Textures; } + } + + public Material[] Materials + { + get { return this.m_Materials; } + } + } +} Deleted: src/test_applications/ItemsViewer/Surface.cs =================================================================== --- src/test_applications/ItemsViewer/Surface.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/Surface.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,126 +0,0 @@ -using System; - -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -using Microsoft.DirectX; -using Microsoft.DirectX.Direct3D; - -namespace RPGWorldModel.ItemsViewer -{ - public sealed partial class Surface : Form - { - private Device m_RenderingDevice; - private IModel m_Model; - - public Surface() - { - this.SuspendLayout(); - - this.ClientSize = new System.Drawing.Size(800, 600); - this.ShowIcon = false; - this.KeyDown += new KeyEventHandler(Surface_KeyDown); - this.Paint += new PaintEventHandler(Surface_Paint); - - this.ResumeLayout(false); - - this.InitializeDevice(); - } - - void Surface_Paint(object sender, PaintEventArgs e) - { - this.RenderSceen(); - } - - float yAngle = 0.0f; - float xAngle = 0.0f; - - void Surface_KeyDown(object sender, KeyEventArgs e) - { - switch (e.KeyCode) - { - case(Keys.Left): - { - this.m_RenderingDevice.Transform.World = Matrix.RotationY((yAngle += 0.1f)); - this.RenderSceen(); - break; - } - case (Keys.Right): - { - this.m_RenderingDevice.Transform.World = Matrix.RotationY((yAngle -= 0.1f)); - this.RenderSceen(); - break; - } - case (Keys.Up): - { - this.m_RenderingDevice.Transform.World = Matrix.RotationX((xAngle += 0.1f)); - this.RenderSceen(); - break; - } - case (Keys.Down): - { - this.m_RenderingDevice.Transform.World = Matrix.RotationX((xAngle -= 0.1f)); - this.RenderSceen(); - break; - } - } - } - - private void InitializeDevice() - { - PresentParameters parameters = new PresentParameters(); - parameters.Windowed = true; - parameters.SwapEffect = SwapEffect.Discard; - - this.m_RenderingDevice = new Device(0, DeviceType.Hardware, - this, CreateFlags.SoftwareVertexProcessing, parameters); - - // Set metrices - this.m_RenderingDevice.Transform.View = Matrix.LookAtLH(new Vector3(0.0f, 0.0f, -100.0f), new Vector3(0.0f, 0.0f, 50.0f), new Vector3(0.0f, 1.0f, 0.0f)); - this.m_RenderingDevice.Transform.Projection = Matrix.PerspectiveFovLH((float)(Math.PI / 2), 1.0f, 1.0f, 100.0f); - } - - public void RenderSceen() - { - this.m_RenderingDevice.Clear(ClearFlags.Target, System.Drawing.Color.Black, 1.0f, 0); - this.m_RenderingDevice.BeginScene(); - - this.m_RenderingDevice.RenderState.Ambient = System.Drawing.Color.FromArgb(0x676766); - - for (int i = 0; i < this.m_Model.Materials.Length; i++) - { - this.m_RenderingDevice.Material = this.m_Model.Materials[i]; - this.m_RenderingDevice.SetTexture(0, this.m_Model.Textures[i]); - this.m_Model.Object.DrawSubset(i); - } - - this.m_RenderingDevice.EndScene(); - this.m_RenderingDevice.Present(); - } - - #region Public properties - - public Device RenderingDevice - { - get - { - return this.m_RenderingDevice; - } - } - - public IModel Model - { - get - { - return this.m_Model; - } - set - { - this.m_Model = value; - } - } - - #endregion - } -} \ No newline at end of file Added: src/test_applications/ItemsViewer/SwordObject.cs =================================================================== --- src/test_applications/ItemsViewer/SwordObject.cs (rev 0) +++ src/test_applications/ItemsViewer/SwordObject.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -0,0 +1,13 @@ +using System; + +using Microsoft.DirectX.Direct3D; + +namespace ItemsViewer.SceenObjects +{ + public class SwordObject : SceenObject + { + public SwordObject(Device device) : base(ref device) + { + } + } +} Deleted: src/test_applications/ItemsViewer/ViewController.cs =================================================================== --- src/test_applications/ItemsViewer/ViewController.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/ViewController.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,54 +0,0 @@ -using System; -using System.IO; -using System.Configuration; -using System.Collections.Specialized; -using System.Windows.Forms; - -namespace RPGWorldModel.ItemsViewer -{ - public sealed class ViewController - { - private Surface m_View; - private Model m_Model; - - public ViewController() - { - this.m_View = new Surface(); - - if (this.LoadModel()) - { - this.m_View.Model = this.m_Model; - this.m_View.ShowDialog(); - } - } - - private bool LoadModel() - { - NameValueCollection models = (NameValueCollection)ConfigurationManager.GetSection("models"); - - if (models != null) - { - using (OpenModelDialog openModel = new OpenModelDialog(models)) - { - Directory.SetCurrentDirectory(Application.StartupPath); - - if (openModel.ShowDialog() == DialogResult.OK) - { - try - { - this.m_Model = new Model(models[openModel.SelectedModel], this.m_View.RenderingDevice); - } - catch - { - return false; - } - - return true; - } - } - } - - return false; - } - } -} Deleted: src/test_applications/ItemsViewer/ViewState.cs =================================================================== --- src/test_applications/ItemsViewer/ViewState.cs 2006-07-03 20:23:33 UTC (rev 9) +++ src/test_applications/ItemsViewer/ViewState.cs 2006-07-06 13:53:21 UTC (rev 10) @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace RPGWorldModel.ItemsViewer -{ - public struct ViewState - { - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |