<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30054920</id><updated>2012-01-15T02:48:50.957-08:00</updated><category term='SQL Reporting Services Divide error'/><category term='.net 4'/><category term='LINQ'/><category term='Artismo'/><category term='downloads'/><category term='3d Modeling Tools'/><category term='WCF'/><category term='workflow'/><category term='.NET Object Binding'/><category term='Content Management Systems'/><category term='VB.NET Unit Testing'/><category term='.xfile load'/><category term='VB.NET'/><category term='codeplex'/><category term='vb.net 2005 floating window'/><category term='XNA Development'/><category term='animated character example'/><category term='WF4'/><title type='text'>Code Monkey Jas Blog</title><subtitle type='html'>Welcome to the Cool world of programming!  This site offers some technical thoughts, tutorials, great finds, solutions, and anything else I feel like posting.  I'ld love to here your feedback!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30054920.post-4151657216788223843</id><published>2011-10-02T01:43:00.000-07:00</published><updated>2011-10-02T01:49:10.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Artismo'/><category scheme='http://www.blogger.com/atom/ns#' term='3d Modeling Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Content Management Systems'/><title type='text'>Artismo on Windows7</title><content type='html'>Artismo is working on Windows 7.  It turned out that I had optimized some of the core code and forgot to update the installer to include the new dll's.  So, we're back up and running.&lt;br /&gt;&lt;br /&gt;I started another project working on a Content Management System.  I should be using this system on the new Artismo Site to start testing the beta.  The CMS is written in C# using MVC3.  &lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-4151657216788223843?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/4151657216788223843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/10/artismo-on-windows7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/4151657216788223843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/4151657216788223843'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/10/artismo-on-windows7.html' title='Artismo on Windows7'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-827193025532844630</id><published>2011-06-18T16:57:00.000-07:00</published><updated>2011-06-21T08:31:58.463-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='codeplex'/><category scheme='http://www.blogger.com/atom/ns#' term='downloads'/><category scheme='http://www.blogger.com/atom/ns#' term='workflow'/><category scheme='http://www.blogger.com/atom/ns#' term='.net 4'/><category scheme='http://www.blogger.com/atom/ns#' term='WF4'/><title type='text'>.NET Workflow WF4 State Machine Activities</title><content type='html'>You may have noticed that workflow has changed drastically from WF 3.5 to WF 4.0.  You may have also noticed that the state machine activities were not shipped with WF 4.0.&lt;br /&gt;&lt;br /&gt;Fortunately, they have been released on Codeplex.  So, here is a link to download the update. &lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4863f88f-5519-4b66-a195-752746b4389a"/&gt;Workflow 4.0 from Codeplex as part of a service pack&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been playing with the new Workflow and let me say I really like it!  Good job WF guys at Microsoft!&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-827193025532844630?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/827193025532844630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/06/net-workflow-wf4-state-machine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/827193025532844630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/827193025532844630'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/06/net-workflow-wf4-state-machine.html' title='.NET Workflow WF4 State Machine Activities'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-6344718104476405322</id><published>2011-06-11T11:38:00.000-07:00</published><updated>2011-06-13T07:56:08.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF, Entity Framework, and LINQ in 15 Minutes</title><content type='html'>In this tutorial we'll use Entity Framework in VB.NET to create a Data Model from our SQL database.  Then, we'll create a WCF Service to fetch a customer using LINQ. Finally, we'll create a Windows Form as a client application to call the WCFService and get back some data.&lt;br /&gt;&lt;style type="text/css"&gt;.nobrtable br { display: none } .tdg{border-width:1px;border-style:solid;padding:3px;border-color:gray;"&lt;/style&gt;&lt;br /&gt;&lt;div class="nobrtable"&gt;&lt;br /&gt;&lt;table style="margin: 0px; font-size: 14px;" border="1"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th style="text-align: left;" colspan="2"&gt;Prerequisites&lt;/th&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td rowspan="3" width="10"&gt; &lt;/td&gt;&lt;td&gt;-Visual Studio 2010&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-Sql Server Express&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-Sql Management Studio (Installed with Sql Express)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="color: black; font-size: 20px; font-weight: bold;"&gt;1. Creating the Database&lt;/div&gt;&lt;br /&gt;To create a simple database for this tutorial: &lt;ol&gt;&lt;li&gt;Open Microsoft Sql Server Management Studio.&lt;/li&gt; &lt;br /&gt;&lt;li&gt;Right-Click on the databases folder and choose New Database.  Name the database "Testeco".&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right-Click on Tables and choose New Table.  Create a table with the following columns:&lt;br /&gt;&lt;div class="nobrtable"&gt;&lt;br /&gt;&lt;table style="border-width: 7px; font-size: 14px;" cellspacing="0"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="tdg"&gt;ID&lt;/td&gt;&lt;td class="tdg"&gt;Primary key, datatype as numeric(18,0) and allow nulls false.  Set Identity to true in properties of column.&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td class="tdg"&gt;Last&lt;/td&gt;&lt;td class="tdg"&gt;Varchar(50)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td class="tdg"&gt;First&lt;/td&gt;&lt;td class="tdg"&gt;Varchar(50)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Name the table "Customer" and hit Save.  I named mine "tblCustomer" out of habit, but if you usually prefix your database objects (e.g. tbl, vw, sp) you may want to stop doing this because these names now bubble up into the object names in the solution.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right-click your table and choose "edit top 200 rows" which will bring up an interface to add rows.  Insert five test rows, hit Save and your database should be ready.&lt;/li&gt;&lt;/ol&gt;&lt;div style="color: black; font-size: 20px; font-weight: bold;"&gt;2. Creating the Solution&lt;/div&gt;&lt;br /&gt;Open Visual Studio 2010.  Create a new project. Under Project Templates Choose Other Project Types-&amp;gt;Visual Studio Solutions: Blank Solution.  Name your project "Testeco" and hit OK.&lt;br /&gt;&lt;br /&gt;&lt;div style="color: black; font-size: 20px; font-weight: bold;"&gt;3. Creating the Data Model Project&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Right-Click your Testeco Solution and choose Add-&amp;gt;New Project. &lt;br /&gt;Choose the Visual Basic-&amp;gt;Class Library and name it "Testeco Data Model" and hit ok.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Delete the Class1.vb file.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right-Click the new project and choose Add-&amp;gt;New Item.  From the list select ADO.Net Entity Data Model, and name it "TestecoDataModel" and hit ok.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;A dialog box will appear.  Select "Generate from Database" and hit next.&lt;/li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-Tej9YvjIJMk/TfQz-izK6cI/AAAAAAAAAJk/_gW9d-kNwpE/s1600/DataModel1.jpg"&gt;&lt;img style="width: 320px; height: 180px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5617171784824187330" border="0" alt="" src="http://3.bp.blogspot.com/-Tej9YvjIJMk/TfQz-izK6cI/AAAAAAAAAJk/_gW9d-kNwpE/s320/DataModel1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;li&gt;The next dialog requires that you specify the database connection. Select new connection.  If you're using sqlexpress you will type the name of the database as localhost\SQLExpress.  Select the testeco database and hit ok. Save the connection string as "TestecoEntities" and hit next.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;To select the database objects, drill down to tables and check the Customer table. Uncheck the option for Pluralize or Singularize generated object names.  This option is not working correctly in the current version but is supposed to be fixed on the next service pack.  Name the namespace as "TestecoModelContext" and hit finish.&lt;/li&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/--DcjujjbDhY/TfQ0e8LzREI/AAAAAAAAAJs/kak4whOJ1XA/s1600/DataModell2.jpg"&gt;&lt;img style="width: 320px; height: 285px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5617172341394195522" border="0" alt="" src="http://1.bp.blogspot.com/--DcjujjbDhY/TfQ0e8LzREI/AAAAAAAAAJs/kak4whOJ1XA/s320/DataModell2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;At this point, you have an Entity Framework Data Model of your table.  You should see a new file called TestecoDataModel.edmx and a diagram of the data model in the designer.  It has generated the classes to handle updating the database with your object changes for you.  Now we are ready to use that data in a service.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: black; font-size: 20px; font-weight: bold;"&gt;4. Creating the WCF Service&lt;/div&gt;&lt;br /&gt;In this step we will create a web project that will host our WCF Service.&lt;ol&gt;&lt;li&gt;Right-Click the new project and choose Add-&amp;gt;New Item. &lt;br /&gt;Select WCF-&amp;gt;WCF Service Application from the options, and name it "WCFTestecoService". Hit OK.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-uDUkctffNf4/TfQ0v8jDgOI/AAAAAAAAAJ0/ZPPpd-UJGeM/s1600/createwcfproject1.jpg"&gt;&lt;img style="width: 320px; height: 225px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5617172633549504738" border="0" alt="" src="http://1.bp.blogspot.com/-uDUkctffNf4/TfQ0v8jDgOI/AAAAAAAAAJ0/ZPPpd-UJGeM/s320/createwcfproject1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Delete the IService1 and Service1 files as we will be creating new ones.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Select this project, right-click and select Add-&amp;gt;New Item and select WCF Service.  Name the file "WCFTestecoService" and hit Add.  It creates the Data Contract(Interface) and Service which implements the contract.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Open the Data Contract called "IWCFTestecoService". It created a sample function called DoWork which we will replace with a function to fetch a customer from our Data Model. Replace the Sub DoWork function with:&lt;br /&gt;&lt;style type="text/css"&gt;.snippy br{ display: none; }.snippy br dl br{display:none;}.snippy dl{padding-left: 50pt;}.snippy{font-family:times new roman;margin-left:10px;font-size:16px;color:black; border-width:1px;border-style:solid;padding:3px;border-color:gray;} .blue{color:blue} .lite{color:#2B91AF}&lt;/style&gt;&lt;br /&gt;&lt;div class="snippy"&gt;&lt;br /&gt;    &lt;span class="blue"&gt;Function&lt;/span&gt; GetCustomer(&lt;span class="blue"&gt;ByVal&lt;/span&gt; id &lt;span class="blue"&gt;As Integer&lt;/span&gt;) As &lt;span class="lite"&gt;Customer&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The compiler will flag the return type Customer as unknown but we will fix that on the next step.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right-click on the project and add-&amp;gt;Class... and name it Customer. At this point our compiler will be happy about returning a Customer type.  But, we need to add two public properties to the class file.  Add two properies to the Customer file for Last and First making your class look like this:&lt;br /&gt;&lt;div class="snippy"&gt;&lt;br /&gt;&lt;span class="blue"&gt;Public Class&lt;/span&gt; &lt;span class="lite"&gt;Customer&lt;/span&gt;&lt;br /&gt;&lt;dl&gt;&lt;span class="blue"&gt;Public Property&lt;/span&gt;First &lt;span class="blue"&gt;As String&lt;/span&gt;&lt;/dl&gt;&lt;dl&gt;&lt;span class="blue"&gt;Public Property&lt;/span&gt;Last &lt;span class="blue"&gt;As String&lt;/span&gt;&lt;/dl&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Something to keep in mind here is that this is not the same class as the Customer coming out of the Entity Framework.  We are creating a simple wrapper to return from the service.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Open the WCFTestecoService file.  There should be a function in there still that says dowork.  We need to rewrite this function so that it implements the new constract we created.  Just delete the dowork function completly, place your cursor at the end of the line that says:  Implements IWCFTestecoService and hit enter.  It will reimplement the interface in your class and write the new function GetCustomer.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Now we need to write the function to get the data out of our datamodel.  But, we need to add a reference to the data model project.  Right-Click on your service project and select Add Reference.  A dialog will appear.  Make sure the Project tab is active and select TestecoDataModel and hit OK.  We have now added the reference to our data model project.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Back to the GetCustomer function, we need to instantiate the datamodel to query against. Add the following to your function:&lt;br /&gt;&lt;div class="snippy"&gt;&lt;br /&gt;&lt;span class="blue"&gt;Public Function&lt;/span&gt; GetCustomer(&lt;span class="blue"&gt;ByVal&lt;/span&gt; id &lt;span class="blue"&gt;As Integer&lt;/span&gt;) As &lt;span class="lite"&gt;Customer&lt;/span&gt; &lt;span class="blue"&gt;Implements&lt;/span&gt;&lt;span class="lite"&gt; IWCFTestecoService&lt;/span&gt;.GetCustomer&lt;br /&gt;        &lt;dl&gt;&lt;span class="blue"&gt;Dim&lt;/span&gt; context = &lt;span class="blue"&gt;New&lt;/span&gt; &lt;span class="lite"&gt;TestecoDataModel&lt;/span&gt;.TestecoEntities()&lt;/dl&gt;&lt;br /&gt;        &lt;dl&gt;&lt;span class="blue"&gt;Dim&lt;/span&gt; result = (span class="blue"&amp;gt;From cust &lt;span class="blue"&gt;In&lt;/span&gt; context.Customers&lt;br /&gt;                     &lt;span class="blue"&gt;Where&lt;/span&gt; cust.id = id&lt;br /&gt;                     &lt;span class="blue"&gt;Select&lt;/span&gt; cust).First&lt;/dl&gt;&lt;br /&gt;        &lt;dl&gt;&lt;span class="blue"&gt;Return&lt;/span&gt; New &lt;span class="lite"&gt;Customer&lt;/span&gt;() &lt;span class="blue"&gt;With&lt;/span&gt; {.First = result.First, .Last = result.Last}&lt;/dl&gt;&lt;br /&gt;    End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;When you update your function two things need to be checked.  First, it may complain about the context.Customers.  If so, remove the .Customers and use intellisense to add the proper table name (yours may be a little different than mine).  Next, it will pick up a missing reference.  if you click on the error it will tell you you're missing a reference to System.Data.Entity.  And if you click it, it will fix it for you.  Great tool!(Wishing C# did this..)  The code should now compile correctly.  But, before we move on let's review this code.&lt;br /&gt;&lt;br /&gt;The context is our datamodel.  We are using Linq to query the context for a customer with a matching ID.  We are returning a new customer and setting the properties of the object before we send it back. &lt;br /&gt;&lt;br /&gt;&lt;li&gt;One last thing to do is to copy the connection string from our app.config file in the EntityFrameWork project into the web.config for our WCFService.  Copy the connectionstring tag out and paste into your web.config. Now, our code can properly reach into the configuration for the connection string it will need.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Build the entire solution and make sure it compiles.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div style="color: black; font-size: 20px; font-weight: bold;"&gt;5. Creating the Client Application&lt;/div&gt;&lt;br /&gt;We will use a windows application to consume the WCF Service and provide an interface to get our data.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-Lm-n2t0d_jI/TfQ1EAegY-I/AAAAAAAAAJ8/g8cp9f4hHrQ/s1600/form1.jpg"&gt;&lt;img style="width: 306px; height: 237px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5617172978201551842" border="0" alt="" src="http://3.bp.blogspot.com/-Lm-n2t0d_jI/TfQ1EAegY-I/AAAAAAAAAJ8/g8cp9f4hHrQ/s320/form1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Add a new project to your solution and choose type Visual Basic-&amp;gt;Windows-&amp;gt;Windows Forms Application and name it ClientApp.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a simple form that looks like the image above.&lt;br /&gt;Name the textboxes as txtID,txtFirst, and txtLast.  &lt;/li&gt;&lt;br /&gt;&lt;li&gt;We need to add a web reference to our WCF Service.  We do this by right clicking the project and selecting "Add Service Reference" which will bring up a dialog. Click the Discover button which will find your web project.  Click on the little arrow next to TestecoService.svc which will show our service contract under it. Selectit in the left (nothing will appear in the right which is okay)  Name it TestecoService.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-5ohmlPkdnss/TfQ1ffeiszI/AAAAAAAAAKE/mFMZQFh9avU/s1600/addwebservice.jpg"&gt;&lt;img style="width: 320px; height: 258px; cursor: pointer;" id="BLOGGER_PHOTO_ID_5617173450379670322" border="0" alt="" src="http://2.bp.blogspot.com/-5ohmlPkdnss/TfQ1ffeiszI/AAAAAAAAAKE/mFMZQFh9avU/s320/addwebservice.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Double-Click the Go button on your form to go to the gobehind code. We need to write code that will take the data form the txtID.Text, get a result from our service, and load it into our textboxes.  The function should look like this:&lt;br /&gt;&lt;div class="snippy"&gt;  &lt;br /&gt; &lt;span class="blue"&gt;Private Sub&lt;/span&gt; btnGo_Click(&lt;span class="blue"&gt;ByVal&lt;/span&gt; sender &lt;span class="blue"&gt;As&lt;/span&gt; System.Object, &lt;span class="blue"&gt;ByVal&lt;/span&gt; e &lt;span class="blue"&gt;As&lt;/span&gt; System.EventArgs) &lt;span class="blue"&gt;Handles&lt;/span&gt; btnGo.Click&lt;br /&gt;        &lt;dl&gt;&lt;span class="blue"&gt;Dim&lt;/span&gt; svs = &lt;span class="blue"&gt;New&lt;/span&gt; TestecoService.&lt;span class="lite"&gt;TestecoServiceClient&lt;/span&gt;&lt;/dl&gt;&lt;br /&gt;        &lt;dl&gt;&lt;span class="blue"&gt;Dim&lt;/span&gt; cust = svs.GetCustomer(&lt;span class="blue"&gt;CInt&lt;/span&gt;(txtID.Text))&lt;/dl&gt;&lt;br /&gt;        &lt;dl&gt;txtFirst.Text = cust.First&lt;/dl&gt;&lt;br /&gt;        &lt;dl&gt;txtLast.Text = cust.Last&lt;/dl&gt;&lt;br /&gt;   &lt;span class="blue"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;We first get a reference to a proxy class that was generated when we added the reference.  we then call the function and get our data back. That's it.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Set the startup project as your ClientApp project and run the program.&lt;/li&gt;&lt;/ol&gt;So, in a few minutes we've used the Entity Framework to create a data model, which we accessed using LINQ in our WCFService, that was used in a simple windows application.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-6344718104476405322?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/6344718104476405322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/06/wcf-entity-framework-and-linq-in-15.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6344718104476405322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6344718104476405322'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/06/wcf-entity-framework-and-linq-in-15.html' title='WCF, Entity Framework, and LINQ in 15 Minutes'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-Tej9YvjIJMk/TfQz-izK6cI/AAAAAAAAAJk/_gW9d-kNwpE/s72-c/DataModel1.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-8993715769170096652</id><published>2011-04-20T20:15:00.000-07:00</published><updated>2011-04-20T20:37:05.750-07:00</updated><title type='text'>3D Boolean Operations</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/-zt-vDcBahmo/Ta-hpcXlfzI/AAAAAAAAAJY/x0VugNHyZAA/s1600/booleanbeforeafter.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 154px;" src="http://4.bp.blogspot.com/-zt-vDcBahmo/Ta-hpcXlfzI/AAAAAAAAAJY/x0VugNHyZAA/s320/booleanbeforeafter.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5597870595206643506" /&gt;&lt;/a&gt;&lt;br /&gt;A Boolean operation is a process of creating a result set from combining two 3D objects. In this case, I'm creating the union of the two objects.  See the picture above of the latest output from the algorithm i'm writing.&lt;br /&gt;&lt;br /&gt;It has been challenging to say the least.  You have to calculate intersection between the objects for both coplanar (flat surface) and nonplanar scenarios.  Once this is done you must triangulate the triangles and then sort them and return the solution.  I'll post more pics after a few more nights of testing. Fun stuff!  Reply if you want me to blog more on the actual algorithms I'm using.  I came up with a few interesting techniques for doing this.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-8993715769170096652?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/8993715769170096652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/04/3d-boolean-operations.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8993715769170096652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8993715769170096652'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2011/04/3d-boolean-operations.html' title='3D Boolean Operations'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-zt-vDcBahmo/Ta-hpcXlfzI/AAAAAAAAAJY/x0VugNHyZAA/s72-c/booleanbeforeafter.bmp' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-5669955425842524883</id><published>2010-12-08T23:10:00.000-08:00</published><updated>2010-12-08T23:33:21.323-08:00</updated><title type='text'>vs2010 Resx Error Not Valid Win32 Application Workaround</title><content type='html'>I had a problem today compiling an app on Windows 7 64-Bit that compiled fine on XP 32 bit.  It turns out that it is a bug in vs2010. This is the workaround that I used just in case you run into it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;br /&gt;Two things were happening. Both of them were related to the resx file of my main form.&lt;br /&gt;1. Images that were used in ImageList or Toolbars were causing a problem.&lt;br /&gt;2. A Matrix from a class property was being cached in the resources now and causing an error.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Workaround&lt;/strong&gt;&lt;br /&gt;I reloaded the GUI images for the toolbar buttons to use images imported into the Properties Resources instead of the Form Resource.  This seemed to clear up that issue.&lt;br /&gt;&lt;br /&gt;Next, I deleted the offending Matrix data out of resx.  I also removed where it was setting the class property in the InitializeComponents function.  Next, I fixed the class so that the Matrix property was not serializable by the designer. So, I wouldn't have to do this again.  This took a piece of metadata above the property to tell it not to set a default value:&lt;br /&gt;       &lt;blockquote&gt;[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;/blockquote&gt;Everything seems to be working after that.  I'll try to post the exact error next time I see it.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-5669955425842524883?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/5669955425842524883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/12/vs2010-resx-error-not-valid-win32.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5669955425842524883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5669955425842524883'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/12/vs2010-resx-error-not-valid-win32.html' title='vs2010 Resx Error Not Valid Win32 Application Workaround'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-525021435307907436</id><published>2010-12-07T22:23:00.000-08:00</published><updated>2010-12-07T23:11:42.200-08:00</updated><title type='text'>BSP Trees in Modern Game Engines</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/TP8sjuVaIOI/AAAAAAAAAJI/pk72cnZ72yY/s1600/binarytree.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 286px; height: 320px;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/TP8sjuVaIOI/AAAAAAAAAJI/pk72cnZ72yY/s320/binarytree.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5548202258188607714" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I first came across BSP when working with the Unreal Engine. We were working in UnrealEd and a level designer was demonstrating how they were using BSP Brushes to make rooms. I thought they looked like plain boxes. And, that’s really all they were until the compile button was pressed and the magic began. Then, those boxes were sliced, diced, lit, packaged, and ready to run.&lt;br /&gt;&lt;br /&gt;Now, as I start planning out my level editor, I find myself thinking about those BSP trees. It has been a few years now, and I begin to wonder if they are the right structure to use in my level editor. &lt;br /&gt;&lt;br /&gt;A Binary Space Partitioning (BSP) Tree is a structure that subdivides space into smaller sections or sets. It has been used in First Person Shooter (FPS) games to solve a problem with rendering polygons in the correct order. It would provide a method to traverse the structure and draw the polygons from back to front quickly. &lt;br /&gt;&lt;br /&gt;But, the need to manually order triangles became less of an issue with the advent of the hardware accelerated Z-buffer. The polygons get pushed onto the GPU to be quickly sorted and processed for rendering.&lt;br /&gt;&lt;br /&gt;That doesn't mean that BSP is obsolete.  Spatial partitions, such as BSP, quad-tree, and octrees, are essential tools in modern rendering engines. They are used in visibility testing, network optimization, collision, and lighting. They can also be computed during compile time.&lt;br /&gt;&lt;br /&gt;There are many discussions on which spatial partition is best. The truth is that they've all got their strengths and weaknesses. Once you've identified the characteristics of your engine, you'll be ready to identify which structure is best for you.  But don't rule out the BSP Tree. They are well documented and still used today in modern engines.  Especially for First Person Shooters.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Related Links:&lt;/strong&gt;&lt;a href="http://www.gamedev.net/reference/programming/features/bsptree/bsp.pdf"&gt;&lt;br /&gt;http://www.gamedev.net/reference/programming/features/bsptree/bsp.pdf&lt;/a&gt;&lt;br /&gt;&lt;a href = "http://en.wikipedia.org/wiki/Binary_space_partitioning"&gt;&lt;br /&gt;http://en.wikipedia.org/wiki/Binary_space_partitioning&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-525021435307907436?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/525021435307907436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/12/bsp-trees-in-modern-game-engines.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/525021435307907436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/525021435307907436'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/12/bsp-trees-in-modern-game-engines.html' title='BSP Trees in Modern Game Engines'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bqVAGqNrmmk/TP8sjuVaIOI/AAAAAAAAAJI/pk72cnZ72yY/s72-c/binarytree.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-8778294425008304227</id><published>2010-12-04T10:45:00.000-08:00</published><updated>2011-05-18T07:58:41.351-07:00</updated><title type='text'>XNA Multiplayer Programming</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/TPqMk-iO1pI/AAAAAAAAAIw/QMcBK8ij_UA/s1600/xnatankintro.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 275px; height: 229px;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/TPqMk-iO1pI/AAAAAAAAAIw/QMcBK8ij_UA/s320/xnatankintro.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5546900457949943442" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In a &lt;a href="http://codemonkeyjas.blogspot.com/2010/11/client-server-game-asynchronous-sockets.html"&gt;previous post&lt;/a&gt; I put together a simple multiplayer tank game with GDI+. But, I decided to change to XNA when I hit a limitation with the game sound.  What a perfect opportunity to make it 3D!&lt;br /&gt;&lt;br /&gt;There are many advantages to using XNA 4.0, especially if you want to play your game on the xbox 360 or Zune. But, keep in mind that if you want to play it on the XBox 360 you will need to purchase a Developers Membership at &lt;a href = "http://create.msdn.com/en-US/home/membership/"&gt;App Hub&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Content Creation&lt;/strong&gt;&lt;br /&gt;The first task is to create the tank model and turret using Artismo 3D. If you want a copy just let me know by commenting on this page. Or send me your e-mail by using my contact page &lt;a href="http://www.rightbytes.com/contact.htm"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The tank in Artismo:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/TPqbW86m4_I/AAAAAAAAAJA/dTjJKyHAOy4/s1600/artismo.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 217px;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/TPqbW86m4_I/AAAAAAAAAJA/dTjJKyHAOy4/s320/artismo.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5546916709671560178" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In Artismo I can create the models and the artwork in one application.  It even does animation for characters. And, supports plug-in architecture to incorporate project-specific processes.  For example, a level editor plug-in could be incorporated into the tool to produce the levels for your game. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tank Movement&lt;/strong&gt;&lt;br /&gt;Moving around a 3D object is a lot easier than in GDI+.  In GDI+ you're only drawing a square bitmap and everything is centered on the upper left corner so you have to move the image up there, rotate it, and put it back.  In 3D you have a matrix and XNA provides really simple functions to rotate or translate the object around.  If you ever used Managed DirectX for Windows it is very similar code.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;User Interface&lt;/strong&gt;&lt;br /&gt;In the first version I had regular windows textbox controls and buttons.  Not in XNA!  You'll have to code them or get a GUI library on the internet.  They're not that hard to code though.  But, the textbox control does take a little work.  If you do a few searches on the internet you can find some examples of doing it. The font support was really easy as well. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Client/Server Protocol&lt;/strong&gt;&lt;br /&gt;On the server side, there were a few changes because I had to send more data now.  Instead of just a position point in 2D and a rotation amount, I changed it to send the tank matrix or transform. It is possible to do it with the original data but it was much easier to pass back and forth the exact data I needed instead of trying to derive the matrix from pieces of information.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sound&lt;/strong&gt;&lt;br /&gt;Sound was a lot easier!  I can play multiple sounds at the same time and XNA even supports stereo functionality so if a tank blasts off a round to your right you can hear it in the right speaker.  I didn't take it that far but atleast it is good to know that it supports it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Collision&lt;/strong&gt;&lt;br /&gt;I used a small 3D ball for the bullet.  To do the collision I created a Bounding Box roughly the same size of the tank. Then, I move the position of the bullet into the model's space and create a Bounding Sphere for it and do collision against the two. All of the collision code is built into XNA. It looks like this:&lt;br /&gt;&lt;blockquote&gt; BoundingSphere sphere = new BoundingSphere(bulletpoint, 0.2f);&lt;br /&gt;                    // create a bounding box for each object.&lt;br /&gt;                    BoundingBox bbox = new BoundingBox(new Vector3(-3, 0, -3), new Vector3(3, 3, 3));&lt;br /&gt;                    bbox.Intersects(ref sphere, out result);&lt;br /&gt;                    if (result)&lt;br /&gt;                    {&lt;br /&gt;                        od.Health -= 1;&lt;br /&gt;                        return true;&lt;br /&gt;                    }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;The end result is a 3D version of my original tank game that can be played on multiple computers.  Some extra features that could be tossed in there is chatting, explosions, etc. That's as far as I'm going with this game.&lt;br /&gt;&lt;br /&gt;Tank Wars Single Player with 20 NPC Tanks:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/TPqMvHQH3BI/AAAAAAAAAI4/P_r6JsMrOiw/s1600/xnatank.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 251px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/TPqMvHQH3BI/AAAAAAAAAI4/P_r6JsMrOiw/s320/xnatank.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5546900632088599570" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://create.msdn.com/en-US/home/membership/"&gt;&lt;/a&gt;&lt;a href="http://create.msdn.com/en-US/home/membership/"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next time we'll discuss level design and make some plug-ins for Artismo to produce the levels.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-8778294425008304227?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/8778294425008304227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/12/xna-multiplayer-programming.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8778294425008304227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8778294425008304227'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/12/xna-multiplayer-programming.html' title='XNA Multiplayer Programming'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bqVAGqNrmmk/TPqMk-iO1pI/AAAAAAAAAIw/QMcBK8ij_UA/s72-c/xnatankintro.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-4076556467766372101</id><published>2010-11-14T12:03:00.000-08:00</published><updated>2010-11-22T00:22:55.723-08:00</updated><title type='text'>XNA 3D Models</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_bqVAGqNrmmk/TOBBWYR9iFI/AAAAAAAAAIg/nukGfObW6MI/s1600/crichton.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 250px;" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/TOBBWYR9iFI/AAAAAAAAAIg/nukGfObW6MI/s320/crichton.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5539499394396424274" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Creating a character from start to finish requires a game plan. I used to work with a content artist that would spend about 8 hours working on a single plant. So, when you're talking about a fully rigged and textured character with multiple animation sequences you start measuring the task in days. And, if it's a main character it may be a few weeks.&lt;br /&gt;&lt;br /&gt;This model above is of John Crighton from the Sci-fi Show FarScape. By the way, if you haven't already, I highly recommend it. Give it a few episodes to get over the puppet factor and it's a really good storyline (Thanks Matt!). Anyway, this character is fully rigged and textured (1900 polys). It took around 8 hours to complete.&lt;br /&gt;&lt;br /&gt;I used a simple mirror tool (In my editor, Artismo) to keep the character symmetrical. And, used extrude and line-flip and line-split functions to shape the character. After finishing the basic shape you want to save a copy for future models to add to your 3D tool box. Note: If you want a copy of my basic model let me know.&lt;br /&gt;&lt;br /&gt;Once you are finished with the shape of the character, you should begin building a basic skeleton. While you're making the skeleton, add some extra bones for the lungs and for the neck as shown here:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/TOCEMIsscgI/AAAAAAAAAIo/oGgVVYMqn4o/s1600/lungbones.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 227px;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/TOCEMIsscgI/AAAAAAAAAIo/oGgVVYMqn4o/s320/lungbones.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5539572885693952514" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You now have a base skeleton and character for any of your characters. You just need to customize them. Note that I didn't attach the model to the skeleton at this time. Since this is a generic character you may end up changing the shape before you're ready to rig it to the bones.&lt;br /&gt;&lt;br /&gt;After doing the rigging, then it is time to paint the character. One mistake I've been guilty of is painting too many of the shadows especially around the neck and face. These fake shadows turned out looking really bad. It is better to use the model geometry and a light shading to augment the character shape. It's not like 2D drawing. This model started looking a lot better after I removed those shadows.&lt;br /&gt;&lt;br /&gt;One tip to keep in mind when texturing is to lay out your geometry on the texture so you can line things up. You don't want to have the backs of the legs pointing upside down if you have to wrap some detailed clothing around it. By the way, next time you're walking around take a look at the patterns on people's clothes and how they wrap. You may notice that none of the patterns line up correctly on the seams. But, they're good at hiding the seams where you won't notice!  Keep that in mind when you do your textures.&lt;br /&gt;&lt;br /&gt;That's about it for now. I've got work to do on my 3D tank game and my next character is Dargo from Farscape. If you want a copy of Artismo let me know.&lt;br /&gt;&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-4076556467766372101?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/4076556467766372101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/11/3d-modeling-tips.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/4076556467766372101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/4076556467766372101'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/11/3d-modeling-tips.html' title='XNA 3D Models'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_bqVAGqNrmmk/TOBBWYR9iFI/AAAAAAAAAIg/nukGfObW6MI/s72-c/crichton.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3258831128736172492</id><published>2010-11-08T13:32:00.000-08:00</published><updated>2010-11-22T00:20:42.438-08:00</updated><title type='text'>C# .NET Asynchronous Sockets Tank Game</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/TNh127yylYI/AAAAAAAAAIY/8nolc5XaJpI/s1600/tankgui.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 197px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/TNh127yylYI/AAAAAAAAAIY/8nolc5XaJpI/s320/tankgui.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5537305328476132738" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First, let me say that this project was not about the graphics and game play.  I wanted to try out some Asynchronous Client Sockets in C#.  Getting sick last week was a good opportunity to try it out since I wasn't going anywhere.  I came up with this little Tank Wars game.&lt;br /&gt;&lt;br /&gt;I kept the client really simple by using GDI+ to draw the bitmaps on the screen.  It just communicates the key events to the server.  All of the game logic and scoring is handled by the server.  Add some basic scoring and sound effects and we have Tank Wars!&lt;br /&gt;&lt;br /&gt;I did hit a roadblock when I decided to add some sound.  I used a simple class called SoundPlayer in C#.  This was great for the Tank shot but was unable to play multiple sounds at the same time.  So, I think it is time to call this exercise finished and move on to the next version.&lt;br /&gt;&lt;br /&gt;Overall, it was a fun little couple hour project that got me exposed to what happens behind the scenes.&lt;br /&gt;&lt;br /&gt;For the next version:&lt;br /&gt;- DirectX Client.&lt;br /&gt;- Really good sound support.&lt;br /&gt;- Polish up the full GUI.&lt;br /&gt;- Make the Server Public so Client can be downloaded.&lt;br /&gt;- Support a SinglePlayer mode.&lt;br /&gt;&lt;br /&gt;Feel free to leave any questions or comments.  I can even post some code up here if anyone is interested.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;br /&gt;&lt;br /&gt;Related Links:&lt;br /&gt;&lt;a href="http://www.codeguru.com/Csharp/Csharp/cs_network/sockets/article.php/c8781/"&gt;Asynchronous Socket Programming in C#&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=tKSYJYV_RGs"&gt;PlaneShift Video on MMORPG Design&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3258831128736172492?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3258831128736172492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/11/client-server-game-asynchronous-sockets.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3258831128736172492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3258831128736172492'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/11/client-server-game-asynchronous-sockets.html' title='C# .NET Asynchronous Sockets Tank Game'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/TNh127yylYI/AAAAAAAAAIY/8nolc5XaJpI/s72-c/tankgui.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-5914108441628266485</id><published>2010-07-11T01:36:00.001-07:00</published><updated>2010-11-22T00:21:06.295-08:00</updated><title type='text'>DirectX 2D Sprite Animation</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/TDmCrVPbICI/AAAAAAAAAIA/hQZ3v78yj58/s1600/pingo.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 256px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/TDmCrVPbICI/AAAAAAAAAIA/hQZ3v78yj58/s320/pingo.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5492564901502853154" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been working on my first plug-in for Artismo 0.11.5 (dev). The Sprite Capture Plug-in will take the current animation sequence and export the animation to a bitmap as a 2D sprite map for import into any 3D Isometric engine.&lt;br /&gt;&lt;br /&gt;The benefit of this plug-in is to quickly generate realistic 3D animations and run them in 2D. Several games use this technique.  For example Diablo, WarCraft III, StarCraft, and other 2D sprite engines.&lt;br /&gt;&lt;br /&gt;I had written a program in the past to allow me to create these animations by hand, but I had to draw every frame.  So, a walk sequence which had 10 frames had to be drawn in 8 directions which was 80 frames for one animation sequence.  So, if you wanted to have the character swing the sword while walking, that was an additional 80 frames.&lt;br /&gt;&lt;br /&gt;With this tool, I create the 3D model with animation, and export any sequence I want.  The penguin above is the test model.  There are a few minor tweaks but this plug-in is almost ready.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-5914108441628266485?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/5914108441628266485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/07/2d-sprite-generation.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5914108441628266485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5914108441628266485'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/07/2d-sprite-generation.html' title='DirectX 2D Sprite Animation'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/TDmCrVPbICI/AAAAAAAAAIA/hQZ3v78yj58/s72-c/pingo.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-6449798255826232531</id><published>2010-06-27T00:34:00.000-07:00</published><updated>2010-11-22T00:21:29.803-08:00</updated><title type='text'>DirectX 3D Modeling in Beta Testing</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/TCb_lwAr5CI/AAAAAAAAAH4/trQ6f1itkVI/s1600/cars.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 160px;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/TCb_lwAr5CI/AAAAAAAAAH4/trQ6f1itkVI/s320/cars.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5487354220005549090" /&gt;&lt;/a&gt;&lt;br /&gt;I released the beta of my editor this weekend.  This evening I began working on the car shown above.  I'll post a finished shot when I'm done.&lt;br /&gt;&lt;br /&gt;I'm looking for a few 3D projects that I can supply my software to for feedback.  It exports animated .X files and I have working examples of how to animate the meshes in XNA and DirectX.  If you have a 2D or 3D project, this may be the tool for you.  I'm working on a tool right now that will export all the animations in a 2D format for sprite engines.  If you're interested in beta testing please let me know.&lt;br /&gt;&lt;br /&gt;Happy coding.&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-6449798255826232531?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/6449798255826232531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/06/3d-modeling-in-beta-testing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6449798255826232531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6449798255826232531'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/06/3d-modeling-in-beta-testing.html' title='DirectX 3D Modeling in Beta Testing'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/TCb_lwAr5CI/AAAAAAAAAH4/trQ6f1itkVI/s72-c/cars.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-1006836115826718612</id><published>2010-06-11T23:27:00.001-07:00</published><updated>2010-06-11T23:58:08.269-07:00</updated><title type='text'>Think out of the Box</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/TBMsywzdJXI/AAAAAAAAAHw/K3XegtCJ1jM/s1600/dexx.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 259px; height: 210px;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/TBMsywzdJXI/AAAAAAAAAHw/K3XegtCJ1jM/s320/dexx.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5481774422045828466" /&gt;&lt;/a&gt;&lt;br /&gt;Just a short thought on solving hard coding problems. We all know that when it comes to writing code, there are usually several ways you can do something. If the way you're doing something seems really difficult, try stepping back and attacking it from a different angle.&lt;br /&gt;&lt;br /&gt;We're not talking about code snippets here. If you're searching for specific code, you can probably find a sample out there. But, as Dex from Starwars would tell you, there's a difference between knowledge and wisdom. Applying the knowledge is where the money is! Do some research and see how people are solving similar problems. And, carry some paper with you so you can doodle designs on the go.&lt;br /&gt;&lt;br /&gt;Most importantly, don't be afraid of failure. Just because you think it will work doesn't mean that it will, but it brings you one step closer to fully understanding the problem. Prototyping is your friend.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-1006836115826718612?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/1006836115826718612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/06/think-out-of-box.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1006836115826718612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1006836115826718612'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/06/think-out-of-box.html' title='Think out of the Box'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bqVAGqNrmmk/TBMsywzdJXI/AAAAAAAAAHw/K3XegtCJ1jM/s72-c/dexx.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-4472357371713331420</id><published>2010-05-14T23:35:00.000-07:00</published><updated>2010-05-14T23:52:33.710-07:00</updated><title type='text'>Bevel Algorithm</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/S-5BkXqMxtI/AAAAAAAAAHo/S0M8BeR2Adw/s1600/Screenshot-5.14.2010.23.34.3.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 250px;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/S-5BkXqMxtI/AAAAAAAAAHo/S0M8BeR2Adw/s320/Screenshot-5.14.2010.23.34.3.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5471382690383840978" /&gt;&lt;/a&gt;&lt;br /&gt;I've been working on this bevel algorithm for about a month now.  Actually, this is the second bevel algorithm I've written for this.  The above box was beveled three times in a row.  I added some colors just to show off the geometry.&lt;br /&gt;&lt;br /&gt;So, with this algorithm there were two challenges. First, was writing an algorithm that worked on all primitives multiple times.  The other was support for the bevel gizmo that allows the user to bevel the object in realtime.&lt;br /&gt;&lt;br /&gt;This is also the first modifier I have that displays text next to the gizmo so no panels with controls are required to perform the task.  Slightly off subject, I tried using blender the other day and my editor is SO much more user friendly!  If you use blender, you'll love mine.&lt;br /&gt;&lt;br /&gt;I still have a lot of work on it but it's nice to be heading in the right direction.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-4472357371713331420?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/4472357371713331420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/05/bevel-algorithm.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/4472357371713331420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/4472357371713331420'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2010/05/bevel-algorithm.html' title='Bevel Algorithm'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bqVAGqNrmmk/S-5BkXqMxtI/AAAAAAAAAHo/S0M8BeR2Adw/s72-c/Screenshot-5.14.2010.23.34.3.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3096830301021668039</id><published>2009-12-23T22:47:00.000-08:00</published><updated>2009-12-23T23:13:00.465-08:00</updated><title type='text'>3D Modeling: Mech Animation</title><content type='html'>My goal was to model a mech robot.  When I first started this model I thought it would be a lot faster than an organic object like a human. And, my first attempt was really fast.&lt;br /&gt;It took me about 5-10 minutes to make this model:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_bqVAGqNrmmk/SzMPfyPgTYI/AAAAAAAAAHM/SVZGTUL3_Sg/s1600-h/mech.bmp"&gt;&lt;img style="margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 248px; height: 282px;" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/SzMPfyPgTYI/AAAAAAAAAHM/SVZGTUL3_Sg/s320/mech.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5418691815394004354" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But, when I tried to texture it I found that it was quite a different process. Instead of being one model, it's more like creating a collection of models.  I attempted to texture it twice before I realized this wasn't working.  So, I decided to take a different approach.  I created a few parts that I could reuse in multiple places and textured them individually.  The result was a much nicer model.&lt;br /&gt;Here is the video of the walk sequence.&lt;br /&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-12a2e66902d361e8" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v19.nonxt1.googlevideo.com/videoplayback?id%3D12a2e66902d361e8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D3B0EDBED6B6289E1D55DA4D62959423C0E7CC9FA.11A4E0607A5B0F5FDA9C03057EDD1054B15545BD%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D12a2e66902d361e8%26offsetms%3D5000%26itag%3Dw160%26sigh%3DSl8wzcaSRiCwontZ61wEYBe5pDg&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v19.nonxt1.googlevideo.com/videoplayback?id%3D12a2e66902d361e8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D3B0EDBED6B6289E1D55DA4D62959423C0E7CC9FA.11A4E0607A5B0F5FDA9C03057EDD1054B15545BD%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D12a2e66902d361e8%26offsetms%3D5000%26itag%3Dw160%26sigh%3DSl8wzcaSRiCwontZ61wEYBe5pDg&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Going through this process exposed a few bugs in my program that needed attention.  My process involves using my tools and discovering things that need improvement or are missing.  Then, fixing the tool so that things go smoother.  The reward for me is not only the model but the ritual.  Someone recently told me that a good programmer has to be a perfectionist.  Always paying attention to every detail.  There's another profession I can think of that requires that same skill.  Only it comes from the other hemisphere of the brain...&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3096830301021668039?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3096830301021668039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/12/3d-modeling-mech-animation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3096830301021668039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3096830301021668039'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/12/3d-modeling-mech-animation.html' title='3D Modeling: Mech Animation'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_bqVAGqNrmmk/SzMPfyPgTYI/AAAAAAAAAHM/SVZGTUL3_Sg/s72-c/mech.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-7622235875869462490</id><published>2009-11-29T15:52:00.000-08:00</published><updated>2010-06-11T23:26:04.538-07:00</updated><title type='text'>Major Tom</title><content type='html'>This weekend I worked on reproducing the "Major Tom" song by Peter Schilling.  I threw some pictures together to create this video for it.&lt;br&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-c9c5b9545faff39d" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v6.nonxt5.googlevideo.com/videoplayback?id%3Dc9c5b9545faff39d%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D1061F72B4C74ED59AF2746C4291C753AC68C5695.281FB6B05A6B08A904C03822542B5676BC483613%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc9c5b9545faff39d%26offsetms%3D5000%26itag%3Dw160%26sigh%3Drrb8sphTuETV0B2s7tQbLdMW_E0&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v6.nonxt5.googlevideo.com/videoplayback?id%3Dc9c5b9545faff39d%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D1061F72B4C74ED59AF2746C4291C753AC68C5695.281FB6B05A6B08A904C03822542B5676BC483613%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc9c5b9545faff39d%26offsetms%3D5000%26itag%3Dw160%26sigh%3Drrb8sphTuETV0B2s7tQbLdMW_E0&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;While I was making this song my computer started to wig out.  It would shut down after about 10 minutes and wouldn't restart.  Well, I checked to make sure everything was properly seated, accidentally dropped the whole thing, and that seems to have done the trick.  Now I'll be able to finish the end of the song properly.&lt;br /&gt;&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-7622235875869462490?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/7622235875869462490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/11/major-tom.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7622235875869462490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7622235875869462490'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/11/major-tom.html' title='Major Tom'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-1181375371539847652</id><published>2009-11-01T00:05:00.000-07:00</published><updated>2009-11-02T08:21:01.216-08:00</updated><title type='text'>DirectX Shaders - Specular Highlighting</title><content type='html'>I've been working on shader support for my editor for the last few days.  So far I've been able to apply a basic vertex and pixel shader to the directx rendering pipeline.  My goal is to make some basic material parameters available to the user without getting too complex.&lt;br&gt;&lt;br /&gt;This picture is shows a model (1900 triangles) I made in the tool and the specular highlighting I was playing with.  Note how he kind of looks like he is made out of plastic.&lt;center&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/Su0ziHfMb7I/AAAAAAAAAG0/klytWvrAEF4/s1600-h/blueshiny.bmp"&gt;&lt;img style=" margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 308px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/Su0ziHfMb7I/AAAAAAAAAG0/klytWvrAEF4/s320/blueshiny.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5399028189505548210" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;br /&gt;&lt;br&gt;  I'm REALLY close to a beta on the editor.  I'm down to wrapping up the materials and finishing up the help files and I should have a downloadable version here before the year is up.  I've been really busy with a class lately so that kind of slowed things up.&lt;br&gt;&lt;br&gt;Happy Coding!&lt;br&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-1181375371539847652?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/1181375371539847652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/11/directx-shaders-specular-highlighting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1181375371539847652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1181375371539847652'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/11/directx-shaders-specular-highlighting.html' title='DirectX Shaders - Specular Highlighting'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/Su0ziHfMb7I/AAAAAAAAAG0/klytWvrAEF4/s72-c/blueshiny.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-7222792862742124662</id><published>2009-10-29T08:03:00.000-07:00</published><updated>2009-10-29T08:40:00.917-07:00</updated><title type='text'>Brain Processing Theory - Processor 4 on fire!</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/SumvKCEXYsI/AAAAAAAAAGs/vlRCbQ1VpII/s1600-h/processor4.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 287px; height: 320px;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/SumvKCEXYsI/AAAAAAAAAGs/vlRCbQ1VpII/s320/processor4.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5398038215268983490" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A few years ago a friend of mine was describing his brain like a computer, which originally had four processors. And, as you get older these processors start to burn out. I thought it was a good illustration and then the other day I realized that I think I lost a processor!&lt;br /&gt;&lt;br /&gt;I was sitting there trying to remember "The Magic Solution" I came up with for a problem at work. Although I could remember the "What" it was supposed to do, the "How" seemed to have slipped my mind. It was like I had lost a few of the essential puzzle pieces. I just couldn't walk through the thought process to come to that solution. This is when I noticed the smoke coming out of processor 4! And, processor 3 mockingly pipes in with the Brain Processing Theory.&lt;br /&gt;&lt;br /&gt;I sit in denial forcing myself to load "The Magic Solution" back into memory only to receive negative response from processors 1-3. They reply: "We don't want anything to do with work from processor 4 or anything else that requires 4 processors! And next time you better be ready to bargain with some sugar or something."&lt;br /&gt;&lt;br /&gt;Now, I'm missing processor four. But, maybe the Brain Processing Theory needs to be expanded just a little... Maybe its a type of self preservation? Maybe Processor 4's main purpose wasn't to process mass quantities of variables and detailed designs and it just decided that enough was enough? Maybe all the processors are in on it and they're taking turns on vacation? No... I'm in denial again. I'm just down to 3 processors at 34. But, I guess there's always a bright side......... Darn it! That must have been on processor 4!&lt;br /&gt;&lt;br /&gt;Has this happened to you? Let me know.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-7222792862742124662?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/7222792862742124662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/10/brain-processing-theory-processor-4-on.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7222792862742124662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7222792862742124662'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/10/brain-processing-theory-processor-4-on.html' title='Brain Processing Theory - Processor 4 on fire!'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/SumvKCEXYsI/AAAAAAAAAGs/vlRCbQ1VpII/s72-c/processor4.bmp' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-1223940792923482145</id><published>2009-07-28T11:03:00.000-07:00</published><updated>2009-07-28T11:48:08.211-07:00</updated><title type='text'>Advertised Shortcuts: Remember the Mulder!</title><content type='html'>I ran into a strange issue with an installer the other day.  I needed to update two computers so I walked over and copied a new exe into the install directory and walked away.  Three days later I noticed that the old program was back on those computers.  Were these the same computers?  All of the settings changes I made were still there.  &lt;br /&gt;&lt;br /&gt;A week later, I ran another program and noticed that everytime I performed a task that created any kind of files, the program showed a reinstalling form when trying to run it from the shortcut.  I also noticed the shortcut target was not the exe.  Hmm, this sounds like something from one of those Microsoft Conferences last year that they were raving about... Something about how Word could be damaged and even uninstalled and would be automatically fixed...&lt;br /&gt;&lt;br /&gt;Welcome to Advertised Shortcuts!  This behavior is part of the "resiliency" feature of the Windows Installer.  When you create a shortcut with your install package they aren't shortcuts to your program.  They are shortcuts to the Windows Installer which will check the version installed and if it is modified, will change it back to the proper state.  It triggers resiliency.&lt;br /&gt;&lt;a href = "http://support.microsoft.com/?id=290997"&gt;http://support.microsoft.com/?id=290997&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?query=shortcut+target&amp;dg=microsoft.public.dotnet.general&amp;cat=en_us_8e56f66a-a6e4-48c0-9a2c-4d224db175b6&amp;lang=en&amp;cr=us&amp;pt=&amp;catlist=&amp;dglist=&amp;ptlist=&amp;exp=1&amp;sloc=en-us"&gt;newsgroup info: Clicking on created shortcut trigers...&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are definately some benefits to this feature.  For example, it blows away your app if it gets a virus.  And, it gives you a warm and fuzzy feeling to know that your software is not going to be abused by someone.  &lt;br /&gt;&lt;br /&gt;Now for the really bad news.  This can be a problem if your program has any external files in the target directory.  For example, log files, data files, config files (including changes to the exe.config), temp files, etc.  If your program changes anything in there, the next time you click on it, POW!  You've just triggered resiliency.  Which means your user is watching an installer run and boy I hope it works because if it doesn't they won't be happy.  Wait they don't have access rights to install?  Oops.  Time to panic.&lt;br /&gt;&lt;br /&gt;Okay, surely there's a way to just configure the installer package to not use advertised shortcuts?  NOPE!!  The answer suggested is to use another utility besides Visual Studio to make the installer package such as WIX or InstallShield.  Huh?  Have you tried WIX? You've just turned your 1 hour install package into an 8 hour march of death. 6 months from now some other programmer will stare in disbelief at that WIX package wondering whether you were chasing the dragon on that day.&lt;br /&gt;&lt;br /&gt;There is actually only one flag that needs to change in the install package.&lt;br /&gt;It is:  DISABLEADVTSHORTCUTS and it needs to be set to 1.&lt;br /&gt;&lt;br /&gt;Now, for the really really bad news.  There is no GUI support for this flag!  Don't worry, there's a solution.:)  What you have to do is download the "Installer SDK" from Microsoft.  No, I'm not kidding... You have to install the Installer SDK! You know we all have that.  :)&lt;br /&gt;&lt;br /&gt;Then, you run ORCA which is a tool to manipulate the data tables for a package and you add this property into the Property tables manually after you build the installer.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/Sm9Bz9Xxr3I/AAAAAAAAAGk/ybzjs3wr3OY/s1600-h/orcasettings.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 204px;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/Sm9Bz9Xxr3I/AAAAAAAAAGk/ybzjs3wr3OY/s320/orcasettings.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5363578042124971890" /&gt;&lt;/a&gt;&lt;br /&gt;If you want to set it up as a Post Build Event in visual studio it is possible.  Follow the instructions here:&lt;br /&gt;&lt;a href ="http://www.discussweb.com/c-programming/13643-advertised-shortcuts-installers-how-avoid.html"&gt;http://www.discussweb.com/c-programming/13643-advertised-shortcuts-installers-how-avoid.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Wait, you don't like this solution?  Well, some people write a custom step in their installer or even there executable to delete the advertised shortcuts and put back regular ones using IShellLink.  (Refer to the last link if you want to go this route).&lt;br /&gt;&lt;br /&gt;So, the moral of this story kids is installers are getting scary.  Or rather, the Operating System you're installing on is paranoid and suffering mental disorders.   Remember, Mulder from X-files?  TRUST NO ONE.&lt;br /&gt;&lt;br /&gt;REMEMBER THE MULDER!&lt;br /&gt;AND&lt;br /&gt;HAPPY CODING!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-1223940792923482145?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/1223940792923482145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/07/advertised-shortcuts-remember-mulder.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1223940792923482145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1223940792923482145'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/07/advertised-shortcuts-remember-mulder.html' title='Advertised Shortcuts: Remember the Mulder!'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bqVAGqNrmmk/Sm9Bz9Xxr3I/AAAAAAAAAGk/ybzjs3wr3OY/s72-c/orcasettings.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3873425555839439821</id><published>2009-07-15T16:03:00.000-07:00</published><updated>2009-07-15T16:13:57.250-07:00</updated><title type='text'>Hard at Work</title><content type='html'>It's been awhile since a post.  I thought I would throw this up here.  This is a picture of me hard at work at the office.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/Sl5gfJmbvnI/AAAAAAAAAGc/Z5pyKH6B1M0/s1600-h/JasDeveloperNotations.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/Sl5gfJmbvnI/AAAAAAAAAGc/Z5pyKH6B1M0/s320/JasDeveloperNotations.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5358826694886801010" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been working for the past few months on about 80 updates to my 3D editor.  Definately a move in the right direction.  I'm currently testing the registration and update system and rewriting a better UV Mapping editor/ art tool.  I'm hoping to post some tutorials here on how to use the program when it is ready for download.  Beta version will be done soon.&lt;br /&gt;&lt;br /&gt;At the office, I'm working on extracting data from a word form and putting the data in another word form.  Fun stuff.  I have a nice little tool that uses a rules file to convert the documents.&lt;br /&gt;&lt;br /&gt;Remember to have lots of beverages when coding!  That way you get out of your chair at least once an hour whether you want to or not.  :)&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3873425555839439821?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3873425555839439821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/07/hard-at-work.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3873425555839439821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3873425555839439821'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/07/hard-at-work.html' title='Hard at Work'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/Sl5gfJmbvnI/AAAAAAAAAGc/Z5pyKH6B1M0/s72-c/JasDeveloperNotations.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-8935217233485346890</id><published>2009-06-16T11:42:00.001-07:00</published><updated>2009-06-16T11:42:40.112-07:00</updated><title type='text'>What superhero am I?</title><content type='html'>Your results:&lt;BR&gt;&lt;B&gt;You are &lt;FONT SIZE=6&gt;Superman&lt;/FONT&gt;&lt;/B&gt;&lt;br /&gt;&lt;TABLE&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE&gt;&lt;TR&gt;&lt;TD&gt;Superman&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=80&gt;&lt;/TD&gt;&lt;TD&gt; 80%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Green Lantern&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=65&gt;&lt;/TD&gt;&lt;TD&gt; 65%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Iron Man&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=65&gt;&lt;/TD&gt;&lt;TD&gt; 65%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Hulk&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=60&gt;&lt;/TD&gt;&lt;TD&gt; 60%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spider-Man&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=55&gt;&lt;/TD&gt;&lt;TD&gt; 55%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Supergirl&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=55&gt;&lt;/TD&gt;&lt;TD&gt; 55%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Wonder Woman&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=50&gt;&lt;/TD&gt;&lt;TD&gt; 50%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;The Flash&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=50&gt;&lt;/TD&gt;&lt;TD&gt; 50%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Catwoman&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=50&gt;&lt;/TD&gt;&lt;TD&gt; 50%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Batman&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=40&gt;&lt;/TD&gt;&lt;TD&gt; 40%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Robin&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;&lt;HR ALIGN=LEFT NOSHADE SIZE=4 WIDTH=32&gt;&lt;/TD&gt;&lt;TD&gt; 32%&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD&gt;You are mild-mannered, good, &lt;BR&gt;strong and you love to help others.&lt;BR&gt;&lt;br /&gt;&lt;IMG SRC="http://www.thesuperheroquiz.com/pics/superman.jpg"&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;A HREF="http://www.thesuperheroquiz.com/"&gt;&lt;br /&gt;Click here to take the "Which Superhero are you?" quiz...&lt;/A&gt;&lt;BR&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-8935217233485346890?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/8935217233485346890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/06/what-superhero-am-i.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8935217233485346890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8935217233485346890'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/06/what-superhero-am-i.html' title='What superhero am I?'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-6355385407020486550</id><published>2009-02-08T21:40:00.000-08:00</published><updated>2009-02-12T09:23:51.610-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XNA Development'/><title type='text'>XNA Game Project</title><content type='html'>&lt;A href="http://1.bp.blogspot.com/_bqVAGqNrmmk/SZBze7BXIiI/AAAAAAAAAFk/ao2tQCpyvj4/s1600-h/tex.bmp"&gt;&lt;IMG id=BLOGGER_PHOTO_ID_5300863736491745826 style="WIDTH: 264px; CURSOR: hand; HEIGHT: 297px" alt="" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/SZBze7BXIiI/AAAAAAAAAFk/ao2tQCpyvj4/s320/tex.bmp" border=0&gt;&lt;/A&gt; &lt;br /&gt;&lt;P&gt;I've been working on a demo project in XNA. This completes my content process for games. I first use my own model editor (going into beta this year) to create the geometry and animations and export a .x file. The level is built in a custom level editor tool we've written for this XNA project, and everything is pulled together in an XNA game engine. &lt;/P&gt;&lt;br /&gt;&lt;P&gt;My first goal for this phase of the project was to animate a .X model in XNA. I searched around on the web and found samples and found one that was close. I started with the skinning sample that is available for download from the XNA Creators Club. It animates a bald soldier ("dude") .FBX file. &lt;A href="http://1.bp.blogspot.com/_bqVAGqNrmmk/SZBzCBI-B2I/AAAAAAAAAFc/38Wih_ENvFU/s1600-h/dude.bmp"&gt;&lt;IMG id=BLOGGER_PHOTO_ID_5300863239918061410 style="WIDTH: 250px; CURSOR: hand; HEIGHT: 200px" alt="" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/SZBzCBI-B2I/AAAAAAAAAFc/38Wih_ENvFU/s320/dude.bmp" border=0&gt;&lt;/A&gt; The issue with this code is that it rendered FBX files AND .X format, but it didn't do any blending between the key frames. This wasn't a problem for the sample model "dude" because it had a ton of frames, but for my animation that was only 10 or so key frames, it posed a real problem. So, I rewrote the code, preprocessor, and HLSL .fx files to properly load and animate .x files. After that, I had used some level editing code to create a height map and load my own model and have him walk around on the height map. &lt;/P&gt;&lt;br /&gt;&lt;P&gt;Here is a video of my western character running around on a test height map. It demonstrates character animation and basic height collision. &lt;/P&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-11850dec18cb5aee" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v16.nonxt5.googlevideo.com/videoplayback?id%3D11850dec18cb5aee%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D70C49E62EB210E2D648D6012EBF7485601A0C85E.2A245F8BB8FCEA711430DF5C8B173AEDEB9A10D%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D11850dec18cb5aee%26offsetms%3D5000%26itag%3Dw160%26sigh%3DjoiTG6Gvj92yZDuYReTqdlyctZU&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v16.nonxt5.googlevideo.com/videoplayback?id%3D11850dec18cb5aee%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D70C49E62EB210E2D648D6012EBF7485601A0C85E.2A245F8BB8FCEA711430DF5C8B173AEDEB9A10D%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D11850dec18cb5aee%26offsetms%3D5000%26itag%3Dw160%26sigh%3DjoiTG6Gvj92yZDuYReTqdlyctZU&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;P&gt;My next goal will be to add some objects with collision such as buildings, towers, and other objects the character can jump on. I'll also be animating a frog for an elementary school project coming up here real quick. I would love to here from anyone on ways to handle objects and areas such as a multi-floored building that the character can go into. &lt;/P&gt;&lt;br /&gt;&lt;P&gt;Happy Coding!&lt;BR&gt;Jason&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-6355385407020486550?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=11850dec18cb5aee&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/6355385407020486550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/02/xna-game-project.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6355385407020486550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6355385407020486550'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2009/02/xna-game-project.html' title='XNA Game Project'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_bqVAGqNrmmk/SZBze7BXIiI/AAAAAAAAAFk/ao2tQCpyvj4/s72-c/tex.bmp' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-866425476186114979</id><published>2008-12-19T16:24:00.001-08:00</published><updated>2008-12-22T08:54:16.323-08:00</updated><title type='text'>Hidden Text in Word</title><content type='html'>This post explains how to collapse multiple sections in a word doc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There may come a time when you need to collapse sections of a word doc based on a checkbox. The sample form I'm using looks like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/SUw8M0YG_GI/AAAAAAAAAFE/kmWYjtaeOc8/s1600-h/sampleform.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5281662653914610786" style="WIDTH: 366px; CURSOR: hand; HEIGHT: 230px" alt="" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/SUw8M0YG_GI/AAAAAAAAAFE/kmWYjtaeOc8/s320/sampleform.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To create this form:&lt;br /&gt;&lt;br /&gt;1. Create a new word doc and add a checkbox.&lt;br /&gt;&lt;br /&gt;2. Type some text under the text box.&lt;br /&gt;&lt;br /&gt;3. Select the area you wish to hide and add a bookmark: Insert-&gt;Bookmark. The Bookmark dialog will appear. Type "Section 1" as bookmark name and close.&lt;br /&gt;&lt;br /&gt;4. Repeat the process two more times.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What we've done is create "Enclosing Bookmarks" around some text. There are actually two types of bookmarks. These are:&lt;br /&gt;&lt;br /&gt;1) Placeholder Bookmarks which look like a beam.&lt;br /&gt;&lt;br /&gt;2) Enclosing Bookmarks that will show up as graphics.&lt;br /&gt;&lt;br /&gt;You can see these book marks by going to Tools-&gt;Options-&gt;Display Bookmarks.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_bqVAGqNrmmk/SUxAKGICzMI/AAAAAAAAAFM/Xz41dzYv_CY/s1600-h/bookmark.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5281667005185969346" style="WIDTH: 443px; CURSOR: hand; HEIGHT: 176px" alt="" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/SUxAKGICzMI/AAAAAAAAAFM/Xz41dzYv_CY/s320/bookmark.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;(Bookmark indicators in Red)&lt;br /&gt;&lt;br /&gt;Now for hooking up the checkboxes.&lt;br /&gt;The Checkboxes need to call a function. So, first we have to write the function. The code should look like so:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;Public Sub Hideit()&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#33cc00;"&gt;'unprotect the document&lt;/span&gt;&lt;br /&gt;If ActiveDocument.ProtectionType &lt;&gt; wdNoProtection Then &lt;br /&gt;ActiveDocument.Unprotect Password:=""&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;ActiveDocument.ActiveWindow.View.ShowHiddenText = False&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#33cc00;"&gt;'Get the range of the bookmark.&lt;/span&gt;&lt;br /&gt;Dim rng As RangeSet rng = ActiveDocument.Bookmarks("Section1").Range&lt;br /&gt;&lt;br /&gt;If ActiveDocument.FormFields("Check1").CheckBox.Value = True Then&lt;br /&gt;&lt;br /&gt;rng.Font.Hidden = 0&lt;br /&gt;Else&lt;br /&gt;rng.Font.Hidden = 1&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True&lt;br /&gt;&lt;br /&gt;End Sub&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Now in the Checkbox, select this function and your&lt;br /&gt;done!&lt;/span&gt; Additional Info here: &lt;a href="http://word.mvps.org/faqs/MacrosVBA/WorkWithBookmarks.htm"&gt;http://word.mvps.org/faqs/MacrosVBA/WorkWithBookmarks.htm&lt;/a&gt; &lt;p&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Happy Coding!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Jas&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-866425476186114979?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/866425476186114979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/12/hidden-text-in-word.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/866425476186114979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/866425476186114979'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/12/hidden-text-in-word.html' title='Hidden Text in Word'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/SUw8M0YG_GI/AAAAAAAAAFE/kmWYjtaeOc8/s72-c/sampleform.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-557154608910953225</id><published>2008-12-03T18:00:00.000-08:00</published><updated>2008-12-10T04:49:28.567-08:00</updated><title type='text'>Line Ring Selection Algorithm</title><content type='html'>I'm thinking about adding a tool that will select a ring of lines.&lt;br /&gt;Here is an example of a ring you want to select.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/SAZTY93X-sI/AAAAAAAAACA/MtF1apuXPrs/s1600-h/selectring1.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5189927308979862210" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/SAZTY93X-sI/AAAAAAAAACA/MtF1apuXPrs/s320/selectring1.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Okay, what I've come up so far is something pretty simple.&lt;br /&gt;1. Copy the target face.&lt;br /&gt;2. Check to see if the selected line is an edge.&lt;br /&gt;3a. Yes, calculate all the edges that are attached to the selected edge and select. END&lt;br /&gt;3b. No, remove all polys that have edges. goto 2.&lt;br /&gt;&lt;br /&gt;This image shows how it would work on the example.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/SAZTmt3X-tI/AAAAAAAAACI/lUBqoJkh8KA/s1600-h/selectring2.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5189927545203063506" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/SAZTmt3X-tI/AAAAAAAAACI/lUBqoJkh8KA/s320/selectring2.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I know there are some exceptions. It seems simple enough. I'll let you know how it works.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-557154608910953225?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/557154608910953225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/04/line-ring-selection-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/557154608910953225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/557154608910953225'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/04/line-ring-selection-algorithm.html' title='Line Ring Selection Algorithm'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/SAZTY93X-sI/AAAAAAAAACA/MtF1apuXPrs/s72-c/selectring1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-1425850188562941280</id><published>2008-11-13T10:18:00.001-08:00</published><updated>2008-11-13T11:06:14.558-08:00</updated><title type='text'>Character Modeling II</title><content type='html'>Picking up from the previous post, I've modeled a basic character using a billboard as a guide. See picture:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/SRxwATwrqZI/AAAAAAAAAEk/zY7woGHSEnc/s1600-h/Screenshot-10.6.2008.21.4.32.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/SRxwATwrqZI/AAAAAAAAAEk/zY7woGHSEnc/s320/Screenshot-10.6.2008.21.4.32.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5268208814723410322" /&gt;&lt;/a&gt; &lt;br /&gt;You can see the bone system residing inside of the character.  For the hands I only needed the ability to move the thumb, index, and rest of fingers as a group so I used three bones.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/SRxwea3wHlI/AAAAAAAAAEs/w5EGE9YJgsU/s1600-h/Screenshot-10.6.2008.21.26.16.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/SRxwea3wHlI/AAAAAAAAAEs/w5EGE9YJgsU/s320/Screenshot-10.6.2008.21.26.16.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5268209332028186194" /&gt;&lt;/a&gt;&lt;br /&gt;Assigning the geometry to the bones:&lt;br /&gt;In my tool I do this by selecting the desired bone. I select the geometry I want to assign to it and associate the selection tot he bone.  In the following image you can see that I have part of the spine selected and I'm assigning verts to the torso.(GREEN=assigned, Yellow=assigned to another bone, BLUE= not assigned at all)&lt;br /&gt;&lt;br /&gt;Note:  In other tools, you'll be able to do this by some tool automatically, but since I haven't coded that, I alternated the model color to help in the assignment process.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/SRx1OUeXydI/AAAAAAAAAE0/bM1u6fKQsNc/s1600-h/Screenshot-10.8.2008.21.32.13.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/SRx1OUeXydI/AAAAAAAAAE0/bM1u6fKQsNc/s320/Screenshot-10.8.2008.21.32.13.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5268214552991353298" /&gt;&lt;/a&gt;&lt;br /&gt;After applying all the geometry to the bones, I created some test animations that ran the character through basic movments.  Each joint was a different animation.&lt;br /&gt;&lt;br /&gt;As I tested the animations, I would make adjustments to the bone assignments, applying multiple bones to influence the points. This is great in areas like the shoulders, hips, knees, and neck.  You'll need to add additional geometry to improve the animations.  My character jumped from 1100 polys to over 1500+ polys by the time I was done with this process.  &lt;br /&gt;&lt;br /&gt;Once the models movement looks acceptable with the test animations you're ready for texturing.  (I made the mistake of texturing first and had to do it again later.  Not too bad but could have saved time to wait.)&lt;br /&gt;&lt;br /&gt;When you're finished texturing your character is ready for producing the real animations.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/SRx2ketIDJI/AAAAAAAAAE8/TJAnrjAhh_A/s1600-h/Screenshot-11.11.2008.22.7.51.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/SRx2ketIDJI/AAAAAAAAAE8/TJAnrjAhh_A/s320/Screenshot-11.11.2008.22.7.51.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5268216033206340754" /&gt;&lt;/a&gt;&lt;br /&gt;The picture above shows my gunslinger (Guns aren't textured yet) in his loiter pose.  This guy was exported in .x format and loaded quite nicely into a demo app.  Total polys (1530).&lt;br /&gt;&lt;br /&gt;Note:  I used my own editor to do this character.  Let me know if you're interested in trying it out.  I'm always looking for people who can give me some suggestions and feedback.&lt;br /&gt;&lt;br /&gt;Thanks for reading and happy coding!&lt;br /&gt;&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-1425850188562941280?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/1425850188562941280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/11/character-modeling-ii.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1425850188562941280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/1425850188562941280'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/11/character-modeling-ii.html' title='Character Modeling II'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/SRxwATwrqZI/AAAAAAAAAEk/zY7woGHSEnc/s72-c/Screenshot-10.6.2008.21.4.32.bmp' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3613490941803859037</id><published>2008-10-06T09:47:00.001-07:00</published><updated>2008-10-06T10:12:56.915-07:00</updated><title type='text'>Character Modeling</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/SOpCmLlHlBI/AAAAAAAAACg/xbgIxhnsRyE/s1600-h/model2.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/SOpCmLlHlBI/AAAAAAAAACg/xbgIxhnsRyE/s320/model2.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5254085138992043026" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/SOpCWMBSO5I/AAAAAAAAACY/4mdKhG7aCoI/s1600-h/model1.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/SOpCWMBSO5I/AAAAAAAAACY/4mdKhG7aCoI/s320/model1.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5254084864232274834" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My goal was to create a model with 1000-1500 polygons.  These are the steps I followed:&lt;br /&gt;&lt;br /&gt;1.  First, I drew and scanned a finished character front and side view in standard pose.  Take the time to get it as close as possible to the real thing here in pencil.&lt;br /&gt;&lt;br /&gt;2.  I took the image and billboarded it in my editor for reference and started building geometry with the same general shape.&lt;br /&gt;&lt;br /&gt;3.  Modeling:  I started with a box and scaled it the size of the chest.  I then worked down the torso and did the legs.  Next, I worked up the neck and did the head.  I then extruded out the arms on both sides, placing geometry in the proper joints to allow for animation.  Doing the hands takes some time.  Basically, extrude out the fingers and play with the vertices.&lt;br /&gt;&lt;br /&gt;The head took quite some time.  After adding detail to the face and moving things around I kept shrinking the head and had to readjust things at the vertex level.  In your tool you probably have a way of using a select box and scaling the selections.  I'm missing that tool.  Doing the ears were not so bad but I had to make it look the same on both sides of the head.&lt;br /&gt;&lt;br /&gt;4.  Grouping the polygons.  I went through and grouped the polygons.  I'm basically associating polygons within region together for the texture mapping stage.&lt;br /&gt;&lt;br /&gt;5.  Texture mapped all the groups (faces in my editor), and sized them to a 2048 bitmap.  Note, this should be done after step 6 next time.  because I'll have to do it again if I change any geometry.&lt;br /&gt;&lt;br /&gt;6.  (Stopped here) Bone support:  Start adding the skeleton and working on animations.  Most likely in this process there will need to be some tweaking of the geometry to improve joint areas.  (This version of my editor has not implement multiple weighted influences on vertices from multiple bones yet. Coming soon.)&lt;br /&gt;&lt;br /&gt;7.  Once animation is good and a few of the animation sequences are finished, the geometry is stable and the texture can be generated to the model.&lt;br /&gt;&lt;br /&gt;8.  Add additional animation sequences.&lt;br /&gt;&lt;br /&gt;What I learned or ran into during the process:&lt;br /&gt;1. I'm really needing a mirror tool, and a few other essential modeling tools.&lt;br /&gt;2. I don't know how I'm going to do the gun yet.  That involved attaching and detaching a bone to the animation.  I'm guessing this will be handled in the engine.&lt;br /&gt;3. It was way more work than I thought it would be but I can use this model as a base for later models if it works out.&lt;br /&gt;4.  Been playing spore and would like to add additional features to my editor that allow me to modify geometry by using the bones themselves.  (Cool!)&lt;br /&gt;5.  I'm not sure yet if the movement (up and down, and jump height) should be coded in the animation or when rendering the animation in the engine.  I'm guessing that should be handled in the engine.&lt;br /&gt;&lt;br /&gt;Would love to hear how this process differed from your experience developing a fully animated model.&lt;br /&gt;&lt;br /&gt;Happy 3Ding!&lt;br /&gt;&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3613490941803859037?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3613490941803859037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/10/character-modeling.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3613490941803859037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3613490941803859037'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/10/character-modeling.html' title='Character Modeling'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/SOpCmLlHlBI/AAAAAAAAACg/xbgIxhnsRyE/s72-c/model2.bmp' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-359082207624558602</id><published>2008-09-22T19:12:00.000-07:00</published><updated>2008-09-29T08:57:09.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='animated character example'/><title type='text'>DirectX Mesh Loading</title><content type='html'>It's been awhile since my last post. I got a little burned out on meshes after working on the xfile format. I did recently write a little app that lets me load my walking sequence and walk the little "Jake" model around. Here's a video.&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-a5c5c5dae867bb64" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v24.nonxt2.googlevideo.com/videoplayback?id%3Da5c5c5dae867bb64%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D44573378DA5FF10448920FF0BE6E4AD58890DF4.455B63BB238A90725DF3594139C5BB435E5F7790%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Da5c5c5dae867bb64%26offsetms%3D5000%26itag%3Dw160%26sigh%3D-Vt6XvRnwz-_zBbWg45ULeD6NtM&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v24.nonxt2.googlevideo.com/videoplayback?id%3Da5c5c5dae867bb64%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D44573378DA5FF10448920FF0BE6E4AD58890DF4.455B63BB238A90725DF3594139C5BB435E5F7790%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Da5c5c5dae867bb64%26offsetms%3D5000%26itag%3Dw160%26sigh%3D-Vt6XvRnwz-_zBbWg45ULeD6NtM&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;This is just a DirectX 8 application with a skinned .x file loaded. I'm going to create a really simple character and start playing with breaking up the animations by lower and upper body as well as moving the head where the camera is pointing. It will support jump, swing, run, walk, back up, sit, and lay. We'll see how it goes. After that I might start working on lighting a little. but, it would be neat to get more than one person moving things. My editor is comign along well. I have a short buglist and then its on to deployment code. If anyone is interested in trying it out let me know in the reply. &lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-359082207624558602?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=a5c5c5dae867bb64&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/359082207624558602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/09/directx-mesh-loading.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/359082207624558602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/359082207624558602'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/09/directx-mesh-loading.html' title='DirectX Mesh Loading'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-5708191899702703410</id><published>2008-07-26T09:19:00.000-07:00</published><updated>2008-09-29T08:57:27.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.xfile load'/><title type='text'>DirectX Animated Character</title><content type='html'>This one is a fully textured version of my Jake character. It has some smoothing on it as well. Only 828 polygons.&lt;br /&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-eae83eed5754db8f" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v6.nonxt5.googlevideo.com/videoplayback?id%3Deae83eed5754db8f%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D3CBF078ABF98FC247E1DA13F7AE8A5D13FD12D02.7A1809766C5609B7AA461A6E9C2DC9E39C598354%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Deae83eed5754db8f%26offsetms%3D5000%26itag%3Dw160%26sigh%3DMAUmfnAqZ9eVzoJFAwZnZfqhNvw&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v6.nonxt5.googlevideo.com/videoplayback?id%3Deae83eed5754db8f%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D3CBF078ABF98FC247E1DA13F7AE8A5D13FD12D02.7A1809766C5609B7AA461A6E9C2DC9E39C598354%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Deae83eed5754db8f%26offsetms%3D5000%26itag%3Dw160%26sigh%3DMAUmfnAqZ9eVzoJFAwZnZfqhNvw&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;I did notice that the new "DirectX Viewer" has some rendering issues with normals and lighting, but it still works.&lt;br /&gt;&lt;br /&gt;Next on the list is loading this file in XNA and blended animations.  I'm hoping to walk this guy around in 3rd person.  &lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-5708191899702703410?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/5708191899702703410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/07/directx-animated-character.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5708191899702703410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5708191899702703410'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/07/directx-animated-character.html' title='DirectX Animated Character'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-5952958430083722704</id><published>2008-07-12T09:20:00.001-07:00</published><updated>2008-07-12T09:36:08.346-07:00</updated><title type='text'>Xfile Export Done and completed build 0.07</title><content type='html'>Yesterday I finally got my xfile exporter to work correctly. It was just a test but it worked! In this video I'm loading an xfile into the DirectX Viewer.&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-daa8fb42ac26259c" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v18.nonxt5.googlevideo.com/videoplayback?id%3Ddaa8fb42ac26259c%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D614BF8A74B7581C1D95848FE5EE7314DBCDF9ADB.200B3DB319771E7E817310511D1B108E779E765C%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Ddaa8fb42ac26259c%26offsetms%3D5000%26itag%3Dw160%26sigh%3DaoVma_KavDnrfbHp8BiaGnxG_6I&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v18.nonxt5.googlevideo.com/videoplayback?id%3Ddaa8fb42ac26259c%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D614BF8A74B7581C1D95848FE5EE7314DBCDF9ADB.200B3DB319771E7E817310511D1B108E779E765C%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Ddaa8fb42ac26259c%26offsetms%3D5000%26itag%3Dw160%26sigh%3DaoVma_KavDnrfbHp8BiaGnxG_6I&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;This model is working as designed. My next test will be a more detailed model. If it works I'll texture it as well. Fun Stuff!&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-5952958430083722704?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=daa8fb42ac26259c&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/5952958430083722704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/07/xfile-export-done-and-completed-build.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5952958430083722704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5952958430083722704'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/07/xfile-export-done-and-completed-build.html' title='Xfile Export Done and completed build 0.07'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-6155685010635618842</id><published>2008-06-27T08:17:00.000-07:00</published><updated>2008-06-27T09:15:07.475-07:00</updated><title type='text'>Exporting DirectX Files for Animation</title><content type='html'>There are two approaches to writing DirectX files. The first is to take your geometry and animation data and stuff it into the D3DX Mesh classes and use Saving functionality. The second approach is to skip the D3DX classes and write a file directly that conforms to the .x format specifications. &lt;br /&gt;&lt;br /&gt;I chose to write my own. I found the documentation and examples for loading D3DX classes inadequate when writing an exporter. Every book/article(msdn site, 3D Game Programming With DirectX 9.0, Managed DirectX 9 KickStart, etc.) will have a chapter on how a Bone hierarchy works and then it will show you the "Tiny.X" file and how to load it from file and animate it. But, where are the good examples (Managed code) and documentation on how to initialize and use these objects when you have all the data already? There are only a few and most are written in outdated versions. Since I didn't build my model and animation classes on D3DX classes, filling those objects did not appeal to me.&lt;br /&gt;&lt;br /&gt;I worked on the format for a few days. I was able to export static meshes quite well. In fact, I had better results with the .x file I wrote then with the one written by the D3DX classes, which I had previously used to export static meshes. The ones from D3DX didn't load well in the newer Mesh Viewer that comes with the DirectX SDK. It only worked in the old one.&lt;br /&gt;&lt;br /&gt;Exporting the Animated Meshes has proven more difficult but I am seeing some good results. I've been tinkering with the transformations and I got it really close. With a little time and some files I'll be exporting.&lt;br /&gt;&lt;br /&gt;Happy Coding.&lt;br /&gt;&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-6155685010635618842?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/6155685010635618842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/06/exporting-directx-files-for-animation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6155685010635618842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6155685010635618842'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/06/exporting-directx-files-for-animation.html' title='Exporting DirectX Files for Animation'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-5632398296197114806</id><published>2008-06-18T08:36:00.000-07:00</published><updated>2008-06-18T08:50:46.955-07:00</updated><title type='text'>DirectX Character Animation II</title><content type='html'>In this animation I've upgraded the model a little. There is the stand, walk, run, and swing sequence. Here's the video: &lt;br /&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-c287da8a7de691f" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v17.nonxt1.googlevideo.com/videoplayback?id%3D0c287da8a7de691f%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D70BC57772B43A7FB32781423618D0B25DF6E1B1.3221E87DCC3739E142E12D144F535479566CEE88%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc287da8a7de691f%26offsetms%3D5000%26itag%3Dw160%26sigh%3DhI642dwA4k_pI4BkpjjjKztfQfE&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v17.nonxt1.googlevideo.com/videoplayback?id%3D0c287da8a7de691f%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D70BC57772B43A7FB32781423618D0B25DF6E1B1.3221E87DCC3739E142E12D144F535479566CEE88%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc287da8a7de691f%26offsetms%3D5000%26itag%3Dw160%26sigh%3DhI642dwA4k_pI4BkpjjjKztfQfE&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;I've also fixed the lighting as you can see in this video. The next one will be fully textured I promise! &lt;br /&gt;&lt;br /&gt;Happy Coding! &lt;br /&gt;&lt;br /&gt;Jason&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-5632398296197114806?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=c287da8a7de691f&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/5632398296197114806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/06/directx-character-animation-ii.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5632398296197114806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5632398296197114806'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/06/directx-character-animation-ii.html' title='DirectX Character Animation II'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-996096403020443207</id><published>2008-06-10T08:01:00.000-07:00</published><updated>2008-06-10T08:23:06.181-07:00</updated><title type='text'>DirectX Character Animation</title><content type='html'>I've made a little progress on my animation system. I made a test model I like to call Fred and attached him to an animated skeleton. See Video.&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-56c93053a6e5941b" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v3.nonxt3.googlevideo.com/videoplayback?id%3D56c93053a6e5941b%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D75AE2F099F7DAE83695A9FFAA37171F1719E6D5.452D278BEB73D0366B168E96C13447CA31E1F747%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D56c93053a6e5941b%26offsetms%3D5000%26itag%3Dw160%26sigh%3D6QT9MC9CiUeBvze5do0fAKyt9GE&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v3.nonxt3.googlevideo.com/videoplayback?id%3D56c93053a6e5941b%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D75AE2F099F7DAE83695A9FFAA37171F1719E6D5.452D278BEB73D0366B168E96C13447CA31E1F747%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D56c93053a6e5941b%26offsetms%3D5000%26itag%3Dw160%26sigh%3D6QT9MC9CiUeBvze5do0fAKyt9GE&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;I know the character isn't that pretty but the important thing is that his skin isn't flying around the screen and he is performing the cheesy walk sequence.  Although I haven't transformed the normals yet so his lighting is really bad.  Next step is to fix normals and start working on weighted blends.&lt;br /&gt;&lt;br /&gt;Later I'll support .x format so I'm going to take a close look at the "Simple Animation" demo from microsoft and utilize their AnimationController and D3DFrame structure. I did find that DirectX render state does support vertex blending with the  D3DRS_VERTEXBLEND flag.  You can read about it here:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb173463(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb173463(VS.85).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;br /&gt;(Note I'm not DXJas anymore because microsoft stopped supporting MDX and that upset me.  Their alternative was to use XNA or roll your own.  XNA Rocks though!  Don't get me started...) :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-996096403020443207?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=56c93053a6e5941b&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/996096403020443207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/06/directx-character-animation.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/996096403020443207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/996096403020443207'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/06/directx-character-animation.html' title='DirectX Character Animation'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-6040165379807013718</id><published>2008-05-26T22:32:00.000-07:00</published><updated>2008-05-26T22:38:04.580-07:00</updated><title type='text'>DirectX Skeletal Mesh Cont.</title><content type='html'>I've been making progress on my animation. So far I can add bones and frames and animate the bones. See this video of my first animation of a hand.&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-4f4494dbeed29239" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v4.nonxt7.googlevideo.com/videoplayback?id%3D4f4494dbeed29239%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D59CD77E6F90314D3B8E23BE9C2E9F8F811CE0DD7.845B3202459112B53711DBBB9B3F42E410ABD767%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D4f4494dbeed29239%26offsetms%3D5000%26itag%3Dw160%26sigh%3DKE1rNe77yH3JDMQ1hWf79mqh61k&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v4.nonxt7.googlevideo.com/videoplayback?id%3D4f4494dbeed29239%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1330275907%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D59CD77E6F90314D3B8E23BE9C2E9F8F811CE0DD7.845B3202459112B53711DBBB9B3F42E410ABD767%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D4f4494dbeed29239%26offsetms%3D5000%26itag%3Dw160%26sigh%3DKE1rNe77yH3JDMQ1hWf79mqh61k&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;p&gt;This was using four key frames. My next task will be to clean up the code, and save the bone animation to file for reloading.  After that I'll start working on attaching geometry to the skeleton.  Woo Hoo! Can you tell I'm having lots of fun?&lt;br /&gt;&lt;br /&gt;I'm pretty sure the attached mesh will have issues in certain areas but I'm hoping that within a few weeks I'll have my first animated mesh and shortly after that my first animated .x file.  My goal here is to create a walk sequence and load the animated mesh into a demo game engine.  I still haven't figured out how I'm going to let the user edit the geometry.  That's going to be quite a shift in process flow.  Oh well.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;&lt;br /&gt;DXJas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-6040165379807013718?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=4f4494dbeed29239&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/6040165379807013718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/05/directx-skeletal-mesh-cont.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6040165379807013718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6040165379807013718'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/05/directx-skeletal-mesh-cont.html' title='DirectX Skeletal Mesh Cont.'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-2279612578979436613</id><published>2008-05-06T13:52:00.000-07:00</published><updated>2008-12-10T04:49:29.562-08:00</updated><title type='text'>DirectX Skeletal System</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_bqVAGqNrmmk/SCDGP3sflwI/AAAAAAAAACQ/aIIES7n_iBU/s1600-h/bones.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/SCDGP3sflwI/AAAAAAAAACQ/aIIES7n_iBU/s320/bones.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5197371945936459522" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now that I'm able to create static meshes, I've begun developing a skeletal system that will allow me to animate them. (See screenshot)&lt;br /&gt;&lt;br /&gt;Next, I'll add gizmos to manipulate the bones, including forward and inverse kinematics, and start playing with key frames and animation. &lt;br /&gt;&lt;br /&gt;The last stage involves attaching the mesh to the skeleton. In some areas it will be necessary to assign vertices to multiple bones to smooth the animation a little.&lt;br /&gt;&lt;br /&gt;I would be happy to here from some of you on what features you feel are essential in a skeletal system. Is path-based movement important or is it easier to create a few key frames? Do you break up your sequences on the mesh for different body parts so they can be combined? For example, the character can play the run sequence AND the eat sequence at the same time?&lt;br /&gt;&lt;br /&gt;Fun stuff! I'll probably be working on this area for the rest of the year.&lt;br /&gt;&lt;br /&gt;Slightly off the subject, the best character editor that I ever saw was the character creator in City of Villains. Another good one was in the &lt;a href="http://video.google.com/videosearch?q=spore+video&amp;sitesearch="&gt;Spore Video&lt;/a&gt; created by Will Wright, the maker of Sims.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-2279612578979436613?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/2279612578979436613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/05/direct-x-bone-system.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/2279612578979436613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/2279612578979436613'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/05/direct-x-bone-system.html' title='DirectX Skeletal System'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_bqVAGqNrmmk/SCDGP3sflwI/AAAAAAAAACQ/aIIES7n_iBU/s72-c/bones.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-7317182537780971393</id><published>2008-03-17T08:30:00.000-07:00</published><updated>2008-12-10T04:49:29.780-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Reporting Services Divide error'/><title type='text'>SQL Reporting Services: Dividing by Zero</title><content type='html'>You finally finish that report in SQL Reporting Services that you've been slaving over and find that there is a big ugly #Error text in the middle of your data.  You can't publish that!  But, how do you handle it?  Lets cover a few ways of fixing this.&lt;br /&gt;&lt;br /&gt;Sample data:&lt;br /&gt;&lt;table border = "1" style=""&gt;&lt;br /&gt;&lt;tr&gt;&lt;th&gt;Budgeted&lt;/th&gt;&lt;th&gt;Spent&lt;/th&gt;&lt;th&gt;% Avail&lt;/th&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;1000&lt;/td&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt;50.00%&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;#ERR&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Your first try at protecting from the divide by zero error might be something like writing an expression in the value field like so:&lt;br /&gt;&lt;blockquote&gt;&lt;font color="blue"&gt;= IIF( Fields!Budgeted.Value=0, 0, Fields!Spent.Value  / Fields!Budgeted.Value)&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This wouldn't work.  Why? the Reporting Services compiler evaluates the results before the IIF.  So, the compiler attempted the division by zero before applying the IIF expression.  (Thanks Dataman!)&lt;br /&gt;&lt;br /&gt;There are a few ways to handle this.  &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.  Denominator DeColorization&lt;/strong&gt;&lt;br /&gt;A quick way to avoid this is to write a little expression for the font color that will turn the font to white if the denominator = zero.&lt;br /&gt;&lt;blockquote&gt;&lt;font color="blue"&gt;= IIF( Fields!budgeted.Value = 0,"White","Black")&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_bqVAGqNrmmk/R96UPF-UsLI/AAAAAAAAABo/TSoD5zshuKk/s1600-h/denominatordecolorization.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_bqVAGqNrmmk/R96UPF-UsLI/AAAAAAAAABo/TSoD5zshuKk/s320/denominatordecolorization.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5178739608545177778" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Denominator De-Demonization.&lt;/strong&gt;&lt;br /&gt;This is the "Dataman" approach when you REALLY feel the urge to fix the data because otherwise the universe may be out of alignment.  :)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;font color="blue"&gt;= IIF( Fields!Budgeted.Value=0, 0, Fields!Spent.Value  / IIF( Fields!Budgeted.Value=0,1,Fields!.Budgeted.Value))&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.  Division SafeCode Routine.&lt;/strong&gt;&lt;br /&gt;This is pretty cool.  In Reporting Services, in the Report Parameters there is a tab for Code.  You can put in a custom function and call it in your report.  The code would be like so:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;font color="blue"&gt;Public Function SafeDivide(Numerator as Double, Denominator as Double) as Double&lt;br /&gt;  If Denominator = 0 then return 0&lt;br /&gt;  Return  (Numerator / Denominator)&lt;br /&gt;End Function&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;In your report you would just set the value like so:&lt;br /&gt;&lt;blockquote&gt;&gt;&lt;font color="blue"&gt;=Code.SafeDivide(Fields!Spent.Value, Fields!Budgeted.Value)&lt;/font&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;That's all for pesky #Error messages in your code.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;P.S.  Thanks goes to Charley for your input.&lt;br /&gt;Jason&lt;br /&gt;"We are the musicians.  We are the dreamers of dreams." - Willy Wonka&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-7317182537780971393?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/7317182537780971393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/03/sql-reporting-services-dividing-by-zero.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7317182537780971393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7317182537780971393'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/03/sql-reporting-services-dividing-by-zero.html' title='SQL Reporting Services: Dividing by Zero'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_bqVAGqNrmmk/R96UPF-UsLI/AAAAAAAAABo/TSoD5zshuKk/s72-c/denominatordecolorization.bmp' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-8174949232298541312</id><published>2008-02-11T08:19:00.000-08:00</published><updated>2008-12-10T04:49:30.052-08:00</updated><title type='text'>Face Texture Mapping</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/R7B2q26pc1I/AAAAAAAAABU/19BCI30IE-s/s1600-h/girlface.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/R7B2q26pc1I/AAAAAAAAABU/19BCI30IE-s/s320/girlface.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5165759251262042962" /&gt;&lt;/a&gt;&lt;br /&gt;Well, I'm working on version 0.0.6 of my 3D Editor.  I'm currently adding a UV Mapping tool and its coming along nicely.  When I'm done, it will have a good set of tools for creating textures.  No need to export and import into another art tool.  I've included a head that I did this weekend.  This build has been very stable and few bugs noted.  Next will be animation.&lt;br /&gt;&lt;br /&gt;If anyone is interested in trying out my beta version of the software, let me know.  I will also be adding support for exporting 2D templates for 2D engines as well.  3D is exported in .x format right now.  But, it also exports xml if you need to read them into your engine that way.  &lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-8174949232298541312?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/8174949232298541312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/02/face-texture-mapping.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8174949232298541312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/8174949232298541312'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2008/02/face-texture-mapping.html' title='Face Texture Mapping'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/R7B2q26pc1I/AAAAAAAAABU/19BCI30IE-s/s72-c/girlface.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-7118101527367887459</id><published>2007-10-23T11:33:00.001-07:00</published><updated>2007-10-23T11:37:18.286-07:00</updated><title type='text'>ASP.NET ObjectDataSource Setting the Object</title><content type='html'>Lets say you have a business object on your webpage and want to bind some listbox or something to it.  You can use the ObjectDataSource object but you have to handle the ObjectCreating event for the ObjectDataSource.  In your handle just set the ObjectInstance argument and you're good to go.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href = "http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasourceeventargs.objectinstance(vs.80).aspx"&gt;msdn2.microsoft.com article&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-7118101527367887459?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/7118101527367887459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/10/aspnet-objectdatasource-setting-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7118101527367887459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/7118101527367887459'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/10/aspnet-objectdatasource-setting-object.html' title='ASP.NET ObjectDataSource Setting the Object'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-9087397950044178324</id><published>2007-10-05T10:06:00.000-07:00</published><updated>2008-12-10T04:49:30.360-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Object Binding'/><title type='text'>Binding with ObjectDataSource</title><content type='html'>It seems like every time I write a page that retrieves data, I end up writing the mega search page.  It takes a lot of extra code to search by several criteria including date ranges and sort types.  You've probably seen these before.  Something like the following image:&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/RwZxmDKC3NI/AAAAAAAAABM/i4MvDmrY8k8/s1600-h/searchby.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/RwZxmDKC3NI/AAAAAAAAABM/i4MvDmrY8k8/s320/searchby.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5117902925049552082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, one way of handling this might be to write a case statement in the search event and write the sql query dynamically for each search type.  That's one way to drive yourself insane.  Why? Because your query will be strung out across 100 lines of code mangled in a mess of case statements and code logic.  When it comes time to update the query its not going to be fun.&lt;br /&gt;&lt;br /&gt;One thing that worked well for me is binding the GridView to an ObjectDataSource.  I wrote a simple base class for my queries with a generic function for running a query.&lt;br /&gt;Example:&lt;br /&gt;&lt;font color="blue" size="smaller"&gt;&lt;br /&gt;public virtual DataTable RunQueryRange(string criteria,string dtstart,string dtend)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        return mDT;&lt;br /&gt;    }&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;For each query type that you have, create a new class that inherits from your base class.  Override the RunQueryRange function and place your query in there.  Just a nice clean query that might pass that string off to a function in your base class that runs a SqlCommand and returns a dataTable.  That way you're not writing the Connection code everytime.  Once you're rolling it takes you about 30 seconds to create a new search type and add it to your page.  Code might look like this:&lt;br /&gt;&lt;font color="blue" size="smaller"&gt;&lt;br /&gt;    public override DataTable RunQuery(string criteria)&lt;br /&gt;    {&lt;br /&gt;        SqlCommand cmd = new SqlCommand("spSearchByEyeColor");&lt;br /&gt;        cmd.CommandType = CommandType.StoredProcedure;&lt;br /&gt;&lt;br /&gt;        cmd.Parameters.Add("@EyeColor", SqlDbType.VarChar).Value = criteria;&lt;br /&gt;        //pass dummy date params to procedure.&lt;br /&gt;        cmd.Parameters.Add("@DTStart", SqlDbType.DateTime).Value = System.DBNull.Value;&lt;br /&gt;        cmd.Parameters.Add("@DTEnd", SqlDbType.DateTime).Value = System.DBNull.Value;&lt;br /&gt;&lt;br /&gt;        return base.RunSqlCmd(ref cmd);&lt;br /&gt;    }&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;So, now lets say you have 10 different classes that do different queries.  In your webpage, you bind the gridview to a new datasource, select object, choose your default search and choose your generic method.&lt;br /&gt;&lt;br /&gt;Now, in your search event write a small case statement that will set the datasources class like so:&lt;br /&gt;&lt;font color = "blue"&gt;&lt;br /&gt; ObjectDataSource1.TypeName = "classQueryByDate";&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Before we say we're done let me explain a little about that generic function we wrote.  It expects some data.  A string criteria, and some dates.  Now, in my case I had to do optional date range searches.  Yours might only need the string criteria.  What you do is set these parameters to a control-textbox when configuring the objectdatasource.  So, whenever the thing fires, it will grab whatever you put into the textbox and pass it to your class.  That's the key.  Now, in the case of date ranges, I always pass values into my classes but I don't always use them if they're not required.  You'll probably need to play with it a little.  I found the objectdatasource would hang up sometimes if I didn't have default values for those dates.&lt;br /&gt;&lt;br /&gt;Another thing you'll need to juggle is postbacks.  I automatically set the ObjectDataSource1.TypeName every time based on the search.SelectedValue in the dropdown.  This solved my problems.&lt;br /&gt;&lt;br /&gt;So, the idea here is writing code that is easy to update and maintain.  If someone says, can you add a search by hair color to that? You can do it in a minute or so.&lt;br /&gt;&lt;br /&gt;Keep in mind there may be a hundred ways to do this.  This is just one of them.  If you have other ways you would like to share I would love to here them.  Specifically if you've been able to remove the switch statement in the search event completely by using some factory pattern or something, please share.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-9087397950044178324?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/9087397950044178324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/10/binding-with-objectdatasource.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/9087397950044178324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/9087397950044178324'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/10/binding-with-objectdatasource.html' title='Binding with ObjectDataSource'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/RwZxmDKC3NI/AAAAAAAAABM/i4MvDmrY8k8/s72-c/searchby.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-2042171021161991730</id><published>2007-06-12T08:32:00.001-07:00</published><updated>2008-12-10T04:49:30.655-08:00</updated><title type='text'>What not to do with a progress bar.</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_bqVAGqNrmmk/Rm68ph4N-pI/AAAAAAAAAA8/WPYF3_PVtTs/s1600-h/adobeinstall.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_bqVAGqNrmmk/Rm68ph4N-pI/AAAAAAAAAA8/WPYF3_PVtTs/s320/adobeinstall.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5075201251747953298" /&gt;&lt;/a&gt;&lt;br /&gt;This morning I installed an update for adobe software.  As the software updated this dialog would display progress from 0% to 50% over and over again for over a minute.  The text on the dialog didn't change at all during the process.  It just seemed to be stuck in one of those out of control infinite updater loops from hell where it tries to perform a task and can't so it just keeps trying over and over again until you run out of patience and kill it.  For your software you may think of a few other ways to utilize the progress bar and dialog in your apps.&lt;br /&gt;&lt;br /&gt;First, the progress bar does go all the way to 100%.  Test your update dialog and make sure it is listing the progress smoothly.&lt;br /&gt;&lt;br /&gt;Second, If you have a long install you have a few choices.  One way to do it is to break them up into a bunch of small tasks and display progress of each individual task and properly display and update the message to the user so that they know what your updater is doing.&lt;br /&gt;&lt;br /&gt;Third, and probably the best way for a large update is to show the total progress for the entire update and change the message text to indicate that something is actually being done.  Your users really want to know how long its going to take so that they can get on with their life.  Why not tell them?  That's why this is the best choice.  &lt;br /&gt;&lt;br /&gt;This updater is a good example of an update dialog.  This is an updater for a Blizzard product.  It shows the progress of the udpate, the percentage completed, and even tells the user an estimated time to completion.  It even has some blinky lights in the title bar that indicates that its doing something!&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/Rm7FlR4N-qI/AAAAAAAAABE/X7euy5IgNDU/s1600-h/wowupdate.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/Rm7FlR4N-qI/AAAAAAAAABE/X7euy5IgNDU/s320/wowupdate.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5075211074338159266" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;P.S.  The game is pretty good too.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-2042171021161991730?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/2042171021161991730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/06/what-not-to-do-with-progress-bar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/2042171021161991730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/2042171021161991730'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/06/what-not-to-do-with-progress-bar.html' title='What not to do with a progress bar.'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_bqVAGqNrmmk/Rm68ph4N-pI/AAAAAAAAAA8/WPYF3_PVtTs/s72-c/adobeinstall.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3148502808044078071</id><published>2007-05-07T08:34:00.000-07:00</published><updated>2008-09-29T08:55:15.052-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET Unit Testing'/><title type='text'>Unit Testing and Mock Objects with NMock2 in VB.NET</title><content type='html'>I've been reading through Jean-Paul Boodhoo's article in Code Magazine "Layered Architecture, Dependency Injection, and Dependency Inversion" and spent some time reading up on the presenter pattern in his original article on microsoft's site in Design patterns on the Model View Presenter.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/06/08/DesignPatterns/"&gt;http://msdn.microsoft.com/msdnmag/issues/06/08/DesignPatterns/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In his article he explains the benefits of using mock objects in your unit tests. Although this post isn't going to go over the details of the article I will cover how I migrated his C# example to VB.NET and other issues I noted in the article.&lt;br /&gt;&lt;br /&gt;First, the NMock2 framework is a useful tool for unit testing. Its a tool that can be added to NUnit to enhance your NUnit tests. If you aren't familiar with unit testing with NUnit I suggest starting there.&lt;br /&gt;&lt;br /&gt;This is a sample of an NMock2 test found on the design patterns article:&lt;br /&gt;C#:&lt;br /&gt;&lt;font color="blue" size="1"&gt;&lt;br /&gt;[Test]&lt;br /&gt;public void ShouldLoadListOfCustomersOnInitialize()&lt;br /&gt;{&lt;br /&gt;mockery = new Mockery();&lt;br /&gt;ICustomerTask mockCustomerTask = mockery.NewMock&lt;ICustomerTask&gt;();&lt;br /&gt;IViewCustomerView mockViewCustomerView = &lt;br /&gt;mockery.NewMock&lt;IViewCustomerView&gt;();&lt;br /&gt;ILookupList mockCustomerLookupList = mockery.NewMock&lt;ILookupList&gt;();&lt;br /&gt;&lt;br /&gt;ViewCustomerPresenter presenter = &lt;br /&gt;new ViewCustomerPresenter(mockViewCustomerView,&lt;br /&gt;mockCustomerTask);&lt;br /&gt;&lt;br /&gt;ILookupCollection mockLookupCollection = &lt;br /&gt;mockery.NewMock&lt;ILookupCollection&gt;(); &lt;br /&gt;&lt;br /&gt;Expect.Once.On(mockCustomerTask).Method(&lt;br /&gt;"GetCustomerList").Will(Return.Value(mockLookupCollection));&lt;br /&gt;Expect.Once.On(mockViewCustomerView).GetProperty(&lt;br /&gt;"CustomerList").Will(Return.Value(mockCustomerLookupList));&lt;br /&gt;Expect.Once.On(mockLookupCollection).Method(&lt;br /&gt;"BindTo").With(mockCustomerLookupList);&lt;br /&gt;&lt;br /&gt;presenter.Initialize();&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Without duplicating the article and taking this line for line I'll just point out a few obvious things. Its a function with an NUnit annotation that tells Nunit it is a test. It creates a mockery class, some objects, and it runs three tests. Now, if you were to run this against your code it would completely pass assuming all your interfaces are created. Why? because the article left out that in the sample code this function also exists in the test code:&lt;br /&gt;&lt;br /&gt;C#:&lt;br /&gt;&lt;font color="blue" size="1"&gt;&lt;br /&gt;[TearDown]&lt;br /&gt;public void TearDown()&lt;br /&gt;{&lt;br /&gt;mockery.VerifyAllExpectationsHaveBeenMet();&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;This little tidbit gets the mockery class to spit out the results of the tests. Okay, now you have a test that fails... Now lets take a look at the VB.NET version. &lt;br /&gt;&lt;br /&gt;&lt;font color="blue" size="1"&gt;&lt;br /&gt;&amp;#60;Test()&gt; _&lt;br /&gt;Public Sub ShouldLoadlListOfCustomersOnInitialize()&lt;br /&gt;mockery = New Mockery()&lt;br /&gt;&lt;br /&gt;Dim mockCustomerTask As ICustomerTask = mockery.NewMock(GetType(ICustomerTask))&lt;br /&gt;Dim mockViewCustomerView As IViewCustomerView = mockery.NewMock(GetType(IViewCustomerView))&lt;br /&gt;Dim mockCustomerLookupList As ILookupList = mockery.NewMock(GetType(ILookupList))&lt;br /&gt;Dim mockLookupCollection As ILookupCollection = mockery.NewMock(GetType(ILookupCollection))&lt;br /&gt;&lt;br /&gt;Expect.Once.On(mockCustomerTask).Method("GetCustomerList").Will(NMock2.Return.Value(mockLookupCollection))&lt;br /&gt;Expect.Once.On(mockViewCustomerView).GetProperty("CustomerList").Will(NMock2.Return.Value(mockCustomerLookupList))&lt;br /&gt;Expect.Once.On(mockLookupCollection).Method("BindTo").With(mockCustomerLookupList)&lt;br /&gt;&lt;br /&gt;Dim presenter As ViewCustomerPresenter = New ViewCustomerPresenter(mockViewCustomerView, mockCustomerTask)&lt;br /&gt;presenter.Initialize()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;You'll notice it's pretty much the same thing. It just has a few syntax changes but the test will work fine. I hope this helps out some VB.NET programmers when trying to get this to work. I found little documentation on it.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3148502808044078071?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3148502808044078071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/05/unit-testing-and-mock-objects-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3148502808044078071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3148502808044078071'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/05/unit-testing-and-mock-objects-with.html' title='Unit Testing and Mock Objects with NMock2 in VB.NET'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-6153768268369998563</id><published>2007-04-26T23:13:00.000-07:00</published><updated>2008-12-10T04:49:30.937-08:00</updated><title type='text'>Editor Update build 0.03</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_bqVAGqNrmmk/RjGXYbuR69I/AAAAAAAAAA0/ydH1ntTAcNw/s1600-h/3Dstarwars.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_bqVAGqNrmmk/RjGXYbuR69I/AAAAAAAAAA0/ydH1ntTAcNw/s320/3Dstarwars.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5057990302528302034" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been working on additional features for my editor.  The two main items I added were:&lt;br /&gt;&lt;br /&gt;Spherical Mapping:  &lt;br /&gt;While doing research for spherical mapping textures to geometry I ran across several examples and tutorials.  Some of which were in published books such as 3D Game Programming with DirectX9.0c A Shader Approach.  Another good one was by the zman(I'll include link later). I found that all of these examples had a rendering issue at the poles.  It took me a little time to come up with a way of solving the problem.  If you need to find out how to do it feel free to post a reply.  I'll post this fix later when I have time.&lt;br /&gt;&lt;br /&gt;Relative Extrusion:&lt;br /&gt;Wrote a new algorithm that takes into account faces with shared edges that are to be extruded.  This feature was a blast to code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-6153768268369998563?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/6153768268369998563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/04/editor-update-build-003.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6153768268369998563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/6153768268369998563'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/04/editor-update-build-003.html' title='Editor Update build 0.03'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bqVAGqNrmmk/RjGXYbuR69I/AAAAAAAAAA0/ydH1ntTAcNw/s72-c/3Dstarwars.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3961848125712641973</id><published>2007-03-21T10:25:00.000-07:00</published><updated>2007-03-21T10:38:30.268-07:00</updated><title type='text'>ASP.NET SqlDataSource Parameters Don't play with HiddenField controls</title><content type='html'>A little piece of information that might be helpful to someone...&lt;br /&gt;If you have a SqlDataSource that has parameters and you are binding them to a control, you may have problems if you try binding them to HiddenField controls.&lt;br /&gt;&lt;br /&gt;I had a simple gridview that was looking up records based on an ID.  I had everything working fine with the sqldatasource bound to a session variable called session("myid").  But, I decided I wanted to cache the value on the page to eliminate timeout issues.  So I added a hiddenfield to the page.  In the page load event I set this hiddenfield with the ID value, just like I did with the session, but the grid would not pull the records anymore.  I tried calling DataBind on the grid and even on the SqlDataSource and it doesn't pull the records.&lt;br /&gt;&lt;br /&gt;When I changed the variable back to a session variable it worked just fine.  I didn't have to call Databind.  The SqlDataSource is smart enough to detect a change in the parameter and will refresh.&lt;br /&gt;&lt;br /&gt;I also tried using a label control.  This one worked fine too.  In my instance, I just wrote at the top of the page "Welcome [label with my userid]"  and I was on to the next task.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3961848125712641973?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3961848125712641973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/03/aspnet-sqldatasource-parameters-dont.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3961848125712641973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3961848125712641973'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/03/aspnet-sqldatasource-parameters-dont.html' title='ASP.NET SqlDataSource Parameters Don&apos;t play with HiddenField controls'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-5677650657302924592</id><published>2007-03-19T12:03:00.000-07:00</published><updated>2007-03-19T12:04:39.964-07:00</updated><title type='text'>Nerd Test</title><content type='html'>&lt;a href="http://www.nerdtests.com/ft_nq.php?im"&gt;&lt;img src="http://www.nerdtests.com/images/ft/nq.php?val=5771" alt="I am nerdier than 90% of all people. Are you nerdier? Click here to find out!"&gt;&lt;/a&gt;&lt;br /&gt;Just took the nerd test.  If you want to take it click on the image.  Happy coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-5677650657302924592?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/5677650657302924592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/03/nerd-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5677650657302924592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/5677650657302924592'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/03/nerd-test.html' title='Nerd Test'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-3948993439347441823</id><published>2007-02-16T17:08:00.000-08:00</published><updated>2008-12-10T04:49:31.140-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vb.net 2005 floating window'/><title type='text'>VB.NET 2005 MDI Docking to Floating Window</title><content type='html'>Have you ever wanted to create a tool panel that can dock on your GUI and free float as a tool window anywhere no the screen?&lt;br /&gt;&lt;br /&gt;You may think that you can just create a child window and set its mdi parent and dock it to the left. But there are issues with this approach when you make it floating and try to redock it. Especially if you have a child window that is using that area of the screen. What I propose here is to to use panels to pull off the trick.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_bqVAGqNrmmk/RdX2Kz4s-MI/AAAAAAAAAAM/DjkcGBLukeU/s1600-h/dock.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5032198824243558594" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_bqVAGqNrmmk/RdX2Kz4s-MI/AAAAAAAAAAM/DjkcGBLukeU/s320/dock.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first step is to create an MDI Parent window. Just create a new project in vs2005 (VB or C#) and set the "IsMdiContainer" property to True. Go ahead and add a menustrip and add a view option with sub options of Left, Right, Floating.&lt;br /&gt;&lt;br /&gt;Next, we want to add a panel to the form and dock it. Go ahead and add panel1. Dock it to the left and throw a textbox on it for testing. Write the code in the menu events to change the dock property of your form. Leave the floating event blank. We'll get to that... If you run your app, you should be able to switch the docking to left and right.&lt;br /&gt;&lt;br /&gt;Create a new form called frmTools. This window will be the container for our panel when we want it to float. Change the FormBorderStyle to SizableToolWindow. Now hit F7 to go to the code view. Add 2 member variable. 1 panel called mPanel and 1 Form1 call mParent. Modify the constructor of frmTools so that you can pass in a reference to Form1 and a reference to a panel. Set these variables before "Initializecomponent."&lt;br /&gt;&lt;br /&gt;Next, create a private function call InitPanel(). What we'll do here is add the panel to the Controls Collection so that it can be rendered. You'll also want to set the Dock property to DockStyle.Fill and remember to use the SuspendLayout() and ResumeLayout(). Essentially, what we've done is create a secondary "Initializecomponent" function. I wouldn't recommend changing the "Initializecomponent" to do this code as it could cause issues during design time in Visual Studio 2005 designer. Once you've created this function call it in your constructor function after "InitializeComponent()."&lt;br /&gt;&lt;br /&gt;Now, lets go back to Form1. In the event for View-&gt;Floating we'll create the frmTools window and call Show().&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;private void floatingToolStripMenuItem_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Form1 form = this;&lt;br /&gt;frmTools tools = new frmTools(ref form, ref panel1);&lt;br /&gt;&lt;br /&gt;this.SuspendLayout();&lt;br /&gt;this.Controls.Remove(this.panel1);&lt;br /&gt;this.ResumeLayout(false);&lt;br /&gt;this.PerformLayout();&lt;br /&gt;tools.Show();&lt;/span&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;}&lt;/span&gt; &lt;/div&gt;&lt;div class="code"&gt;&lt;br /&gt;Notice that I created a form and set it to "this" and then passed the reference to form into the function. There are other ways of referencing the main form. This was just a quick and dirty way. Maybe we'll get into that on another day. :) &lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;In addition, we removed the item from the controls collection. Now, in testing I was able to remove this code completely and got the same results but lets play it safe. (BTW: If you know why this is so, please comment on the blog, thanks.)&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;Anyway, if you run your application you get your panel to float! Not to bad. One problem remains though. If you close the tool window your panel is now gone. Its been destroyed with the frmTool Control collection. So, we need to let the Parent window know that we are done with the panel. And we have to code a function in the parent window so that it can reinitialize the panel. &lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;In Form1, create a new function called SetToolPanel(ref Panel panel).&lt;/div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;public void SetToolPanel(ref Panel panel)&lt;br /&gt;{&lt;br /&gt;this.SuspendLayout();&lt;br /&gt;this.panel1 = panel;&lt;br /&gt;//set the dockstate to default.&lt;br /&gt;panel1.Dock = DockStyle.Left; &lt;/span&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;this.Controls.Add(this.panel1);&lt;br /&gt;this.Controls.SetChildIndex(this.panel1, 0);&lt;br /&gt;this.ResumeLayout(false);&lt;br /&gt;this.PerformLayout();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;What we're doing here is something similar to "InitializeComponent()." We're just adding this control back in. Notice that I called "Controls.SetChildIndex." I did this because if you don't have these controls in the right order it could affect other docking controls. If you were to comment out this line and test, it would mess up the docking on your menustrip. So, remember to set it properly in your app.&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;Next, we need to modify the frmTools window so that it passes this panel back to the parent when its closing. In the properties window of frmTools, click the Events lightning bolt and override the "FormClosing" event under "Behavior." Call it onClosing. In this function we're only going to call "SetToolPanel" and remove the panel from the control collection so it doesn't get wiped out.&lt;/div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;private void onClosing(object sender, FormClosingEventArgs e)&lt;br /&gt;{&lt;br /&gt;//Pass it off to the parent.&lt;br /&gt;mParent.SetToolPanel(ref mPanel);&lt;br /&gt;//Remove the control so it doesn't get ditched.&lt;br /&gt;this.Controls.Remove(mPanel);&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="code"&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;Thats it. Running the program you'll have a floatable dockable panel for your app. While testing, type something in the panel's textbox to show that its the same panel when it cycles through its states.&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;If you need source code let me know...&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;Happy Coding!&lt;/div&gt;&lt;div class="code"&gt;&lt;/div&gt;&lt;div class="code"&gt;Jas &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-3948993439347441823?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/3948993439347441823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/02/vbnet-2005-mdi-docking-to-floating.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3948993439347441823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/3948993439347441823'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/02/vbnet-2005-mdi-docking-to-floating.html' title='VB.NET 2005 MDI Docking to Floating Window'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bqVAGqNrmmk/RdX2Kz4s-MI/AAAAAAAAAAM/DjkcGBLukeU/s72-c/dock.bmp' height='72' width='72'/><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-116962172756306956</id><published>2007-01-23T22:50:00.000-08:00</published><updated>2007-01-23T23:11:13.150-08:00</updated><title type='text'>3D Blueman</title><content type='html'>&lt;a href="http://photos1.blogger.com/x/blogger/2306/3216/1600/861599/Screenshot-1.23.2007.22.44.26.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/x/blogger/2306/3216/320/227739/Screenshot-1.23.2007.22.44.26.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;This is a quick post of the first human head I've done in my editor (120 polys).  I'm working on build 0.03 now.  This one exports .x files for import into engines.  Although it does texture mapping this picture doesn't show it.  I'm really trying to keep the feature set down to a minumum until I work out the geometry workflow.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-116962172756306956?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/116962172756306956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/01/3d-blueman.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116962172756306956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116962172756306956'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2007/01/3d-blueman.html' title='3D Blueman'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-116294144261785074</id><published>2006-11-07T15:13:00.000-08:00</published><updated>2006-11-07T15:21:06.406-08:00</updated><title type='text'>3D Desk</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/2306/3216/1600/desk1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/2306/3216/320/desk1.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, I got to use my editor at work today. They needed a graphic of an 8 x 10 cubicle for our case managers. Kakoa, our Visio guru was out today, and so I gave it a go with my new editor. I didn't have much time to do the modeling but it turned out okay. I added a little shadowing in Photoshop but that was about it.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-116294144261785074?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/116294144261785074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/11/3d-desk.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116294144261785074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116294144261785074'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/11/3d-desk.html' title='3D Desk'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-116284055399554800</id><published>2006-11-06T10:52:00.000-08:00</published><updated>2006-11-06T11:16:36.220-08:00</updated><title type='text'>SQL Views with an ID column</title><content type='html'>I was recently given the task of replacing a table with a view and this table had an id column. There is a way to represent this id column in a view.&lt;br /&gt;&lt;br /&gt;The following article explains the way to handle it:&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/186133"&gt;http://support.microsoft.com/kb/186133&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Keep in mind the limitations of this approach. Your row count can't be that large. If you have a large set of data and can use snapshots, consider using a temp table filled periodically for reporting. This will improve your query size and enable additional indexes if you require them.&lt;br /&gt;&lt;br /&gt;Happy Coding!&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-116284055399554800?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/116284055399554800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/11/sql-views-with-id-column.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116284055399554800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116284055399554800'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/11/sql-views-with-id-column.html' title='SQL Views with an ID column'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-116052348803552637</id><published>2006-10-10T16:00:00.000-07:00</published><updated>2006-10-11T10:53:12.373-07:00</updated><title type='text'>SQL Case Statement Where?  Use the "Dataman Maneuver"</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/2306/3216/1600/cookieMintster_sm.gif"&gt;&lt;img style="CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/2306/3216/320/cookieMintster_sm.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;Lets say you have an ice cream application. And you have two tables. One for storing the base ice cream and another for storing the actual flavors that are offered by the store. Your tables would have the following data:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/2306/3216/1600/icecream.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/2306/3216/320/icecream.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next, lets say that you have a dropdown for the base ice cream type which stores as its value the bid. In addition, one of the options is "ALL" with a value of "0." How would you write a query that will give you the rows from tblFlavors?&lt;br /&gt;&lt;br /&gt;In VS.NET 2.0 you can add parameters to your selectcommand in the sqlDataSource control. Then, you can configure the parameter to get the value from your dropdown box. But, you have to do some work on the query to get this to work... Enter the Case statement in the where clause. Also known ast the "Dataman Maneuver" by certain trekky programmers with the initials of CRJones. :) You can visit Charley Jones at &lt;a href="http://crjones.com"&gt;http://crjones.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;At first attempt you might try:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT * FROM tblFlavors f &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;WHERE f.bid = @bid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This would work, but what would happen when you select the "All?" You wouldn't get any rows. You don't have any rows with a BID of 0. Enter the power of the Case statement in the where clause.&lt;br /&gt;&lt;br /&gt;When you take a look at the where clause above, the WHERE clause is comparing the value of the bid for each row to the parameter @bid. This is a boolean operation. It is either true or false. All it cares about is whether the variables on both sides of the operator are the same datatype and that it can compare them. So, this allows us to do some crazy things with cases.&lt;br /&gt;&lt;br /&gt;Lets try something else:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT * FROM tblFlavors f&lt;br /&gt;WHERE (Case when @Bid = 0 then 1 else 0 end) = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this statement what are the two variables that are being compared? The right side is a 1, and the left side is whatever my case spits out. The database is smart enough to execute the case first and then compare the result against your 1. If you were to run your application, it would only work when you selected the "All" option. If you selected another option such as Vanilla, you would get nothing because @Bid would be = to 1 and in the above 1 isn't 0 so it returns 0. 0 doesn't = 1.&lt;br /&gt;&lt;br /&gt;The solution is:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT * FROM tblFlavors f&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;WHERE (Case when @Bid = 0 then 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;when @Bid = f.Bid then 1 else 0 end) = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here it will check the first statement.&lt;br /&gt;Does @Bid = 0?&lt;br /&gt;yes: return the 1.&lt;br /&gt;no: check the next one.&lt;br /&gt;Does @Bid = f.Bid?&lt;br /&gt;yes: return the 1.&lt;br /&gt;no: go to else which returns 0.&lt;br /&gt;&lt;br /&gt;Now, it checks the case value to 1 and if this is true you get your row.&lt;br /&gt;&lt;br /&gt;Happy Coding&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-116052348803552637?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/116052348803552637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/10/sql-case-statement-where-use-dataman.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116052348803552637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/116052348803552637'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/10/sql-case-statement-where-use-dataman.html' title='SQL Case Statement Where?  Use the &quot;Dataman Maneuver&quot;'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-115409811002074232</id><published>2006-07-28T07:35:00.000-07:00</published><updated>2006-07-28T08:31:45.303-07:00</updated><title type='text'>Cool Controls: Custom Validators</title><content type='html'>&lt;span style="color:#000000;"&gt;Custom validators are pretty cool to use in ASP.NET 2.0. There are quite a few samples on the web for getting these hooked up. However, most of the samples are REALLY simple in the client-side script. I wanted to throw this one out there just in case someone else has to do something similar.&lt;br /&gt;&lt;br /&gt;The Sample:&lt;br /&gt;Lets say you have a checkbox and a DropDownList, and you want the DropDownList to have validation on it only when the checkbox is checked. When the checkbox is not checked you want the DropDownList disabled. Okay, sounds pretty simple, but can we do it without a postback.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Toggling the Disabled property&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;The JavaScript to toggle the DropDownList disabled property can be done like so:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&amp;lt;script type="text/JavaScript"&amp;gt;&lt;br /&gt;function Change(chkfield,field)&lt;br /&gt;{&lt;br /&gt;if (chkfield.checked == true)&lt;br /&gt;{ document.getElementById(field).disabled = false; }&lt;br /&gt;else&lt;br /&gt;{ document.getElementById(field).disabled = true; }&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Notice that I'm passing in the checkbox object and the field to be disabled. The DropDownList will be called "dd1."&lt;br /&gt;In the checkbox you just plug in the function like so:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&amp;lt;input id="chk1" title="chk1" onclick="Change(this,'dd1')" type="checkbox" value="X" name="chk1"&amp;gt;MyCheckBox&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;strong&gt;Adding the CustomValidator&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Next we add the CustomValidator control after the checkbox. The code would like the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&amp;lt;asp:CustomValidator&lt;br /&gt;ID="CustomValidator1" runat="server" ClientValidationFunction="Checkit" ControlToValidate="dd1"&lt;br /&gt;ErrorMessage="Required Field" Font-Size="Large"&amp;gt;*&amp;lt;/asp:CustomValidator&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;With the CustomValidator control you can supply a "ClientValidationFunction" that will be called. Remember to provide a server-side function as well because if you don't it can be a security risk according to Microsoft. For this example I left that out.&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The Validation Function&lt;/strong&gt;&lt;br /&gt;The validation function, called "Checkit" in this example, &lt;span style="color:#000000;"&gt;will check the validation of the DropDownList "dd1." &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;This function would look like this:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&lt;span style="color:#3333ff;"&gt;function Checkit(sender, args)&lt;br /&gt;{&lt;br /&gt;if(!document.getElementById(sender.controltovalidate).disabled &amp;&amp;amp; args.Value=="bad")&lt;br /&gt;{&lt;br /&gt;args.IsValid=false;&lt;br /&gt;}else{&lt;br /&gt;args.IsValid=true;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;span style="font-size:100%;color:#000000;"&gt;Notice that the function is checking for a value of "bad" in the args.Value. The CustomValidator doesn't like having null values in there so just put the word "bad" in the value of your empty selector item in the dropdownlist. There was a hack for getting this to work with null values but for this example this should do nicely.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:100%;color:#000000;"&gt;Anyway, that's it for the Custom Validator control. Another cool control in the ASP.NET arsenal.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;color:#000000;"&gt;Happy Coding!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;DX Jas&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-115409811002074232?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/115409811002074232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/07/cool-controls-custom-validators.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115409811002074232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115409811002074232'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/07/cool-controls-custom-validators.html' title='Cool Controls: Custom Validators'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-115220501656289518</id><published>2006-07-06T09:40:00.000-07:00</published><updated>2006-07-10T08:35:54.866-07:00</updated><title type='text'>Problem stretching images with GDI+</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/2306/3216/1600/zoomtest.0.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/2306/3216/320/zoomtest.0.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I've noticed a problem when trying to zoom in on an image using the DrawImage method. The above image shows the problem. Basically, if you scale the image, the first row and column doesn't get scaled correctly. I've posted the problem twice on &lt;a href="http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21908252.html"&gt;Expert-Exchange&lt;/a&gt; but have not found an explanation or fix yet.&lt;br /&gt;&lt;br /&gt;I created a test app that takes a 40x40 bitmap with a checkerboard pattern and zooms it by a zoomfactor. The render code is as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;Protected Overrides Sub OnPaint(ByVal e As&lt;br /&gt;System.Windows.Forms.PaintEventArgs) Try&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;If (bmp Is Nothing) Then&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;Else&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;Dim g As &lt;/span&gt;&lt;/span&gt;&lt;a class="iAs" style="COLOR: darkgreen; BORDER-BOTTOM: darkgreen 1px solid; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" href="http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21908252.html#" target="_blank"&gt;&lt;span style="font-size:85%;color:#3366ff;"&gt;Graphics&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt; = e.Graphics() &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;g.SmoothingMode = Drawing2D.SmoothingMode.None&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;g.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;g.SmoothingMode = Drawing2D.SmoothingMode.None&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;Dim rect As New Rectangle&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;rect.X = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;rect.Y = 0&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;rect.Width = (bmp.Width * m_ZoomLevel)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;rect.Height = (bmp.Height * m_ZoomLevel) &lt;/span&gt;&lt;span style="color:#33cc00;"&gt;'attribute shows that destination rect is&lt;br /&gt;the right size but not needed for test.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;Dim attr As System.Drawing.Imaging.ImageAttributes&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;attr = New System.Drawing.Imaging.ImageAttributes()&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;attr.SetWrapMode(System.Drawing.Drawing2D.WrapMode.TileFlipXY) &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;g.DrawImage(bmp, rect,0, 0, 40, 40, GraphicsUnit.Pixel, attr) &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;attr.Dispose()&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;Catch ex As Exception&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;&lt;br /&gt;MessageBox.Show("ouch")&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;End Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;p&gt;&lt;br /&gt;This bug has been posted to Microsoft and confirmed by other programmers.  A fix is to do the following:&lt;/p&gt;&lt;p&gt;Use (-0.5 + 0.5*srcw/dstw, -0.5 + 0.5*srch/dsth) as the source origin.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Happy Coding!&lt;br /&gt;Jas &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-115220501656289518?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/115220501656289518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/07/problem-stretching-images-with-gdi.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115220501656289518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115220501656289518'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/07/problem-stretching-images-with-gdi.html' title='Problem stretching images with GDI+'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-115142468891611214</id><published>2006-06-27T08:56:00.000-07:00</published><updated>2006-06-27T09:11:28.960-07:00</updated><title type='text'>A buggy lesson</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/2306/3216/1600/mosquito.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/2306/3216/320/mosquito.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Two nights ago I was laying in my bed just about to fall asleep when I thought I heard a bug trying to fly in my ear. I jumped out of bed, turned the light on and couldn't find him. Finally I went back to bed after not finding the bug and just as I was approaching dreamland, I thought I heard the bug again. This happened several times during the night.&lt;br /&gt;&lt;br /&gt;At some point, I started questioning my sanity. I thought maybe my brain was making up sounds that weren't there. Or, maybe my years of loud music had caught up with me and this was some sort of hearing damage.&lt;br /&gt;&lt;br /&gt;(There is a coding point to this...) In the morning, I had two gigantic goose egg bites on my right arm. AHA! there was a bug.&lt;br /&gt;&lt;br /&gt;At this point, I knew there was a bug and I had to find it. To make a long story short, two nights later and 6 bites total and I caught the bugger!&lt;br /&gt;&lt;br /&gt;The moral of this story:&lt;br /&gt;1. When writing programs never give up on a bug.&lt;br /&gt;2. If you can't reproduce it or find evidence of the bug, don't let it drive you insane because it can. Take some time away from it and go back later. In time, you'll be able to isolate it.&lt;br /&gt;3. Where there is one bug, there are usually two. Remember that unit testing can help but the test can only check logic that you coded for. Review your code change at another time you may spot others. (Yes, there were two mosquitos! I found one on the same wall 5 minutes later!!)&lt;br /&gt;&lt;br /&gt;Happy Coding!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-115142468891611214?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/115142468891611214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/buggy-lesson.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115142468891611214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115142468891611214'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/buggy-lesson.html' title='A buggy lesson'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-115099065759729214</id><published>2006-06-22T08:22:00.000-07:00</published><updated>2006-06-22T08:38:26.480-07:00</updated><title type='text'>My Geometry Editor</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/2306/3216/1600/house1.jpg"&gt;&lt;img style="float:top; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/2306/3216/320/house1.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;I've been working on my own geometry editor now for about a year.  Its written in C# vs.2005.  I should be ready to push out a beta version of it in a few months.  The image is one I did on the weekend.  &lt;br /&gt;&lt;br /&gt;Development has really slowed since my second son Bryce was born in February.  I'm just starting to get some work done on it now.  I've been working on the rotation gizmo for the last few days.  I have it working pretty well now.&lt;br /&gt;&lt;br /&gt;What I'm looking for are beta testers or hobbyists who would like to use it on a project.  It will output .X files but I can create other outputs as well if needed.  Please post a reply if you're interested and describe the project you would like to work on.  Its okay for low poly objects but not so great for organic objects yet.  It has pretty limited tools.  I'll keep posting my progress as I go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-115099065759729214?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/115099065759729214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/my-geometry-editor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115099065759729214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115099065759729214'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/my-geometry-editor.html' title='My Geometry Editor'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-115091637322991246</id><published>2006-06-21T11:50:00.000-07:00</published><updated>2006-06-22T08:39:34.853-07:00</updated><title type='text'>Table vs CSS layout for forms</title><content type='html'>Separating layout elements from your information is an essential element in web design.  But when it comes to form design, sometimes its quicker to use the tables.&lt;br /&gt;&lt;br /&gt;For example, I've done the last three web forms (10-30 fields) using CSS layout.  They look good, but they took twice as long to write all the css to align the items in different patterns.  What am I saving here?  Were the styles reusable? Not really.  &lt;br /&gt;&lt;br /&gt;Lets face it we aren't going to be changing the entire look of our input forms.  The page itself?  Maybe.  &lt;br /&gt;&lt;br /&gt;Even in Eric Meyers CSS book he used tables for the input forms examples.&lt;br /&gt;&lt;br /&gt;So in conclusion:&lt;br /&gt;Styles for layout: Good.&lt;br /&gt;Styles for forms: Think about designing around the table.&lt;br /&gt;&lt;br /&gt;Jas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-115091637322991246?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/115091637322991246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/table-vs-css-layout-for-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115091637322991246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115091637322991246'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/table-vs-css-layout-for-forms.html' title='Table vs CSS layout for forms'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30054920.post-115091444384722942</id><published>2006-06-21T11:16:00.000-07:00</published><updated>2006-06-21T11:27:23.856-07:00</updated><title type='text'>Docking in VS.NET 2005</title><content type='html'>I was looking for a quick way to solve a docking issue in dotnet and I stumbled across this blogsite on cranky programming. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://crankydotnet.blogspot.com"&gt;http://crankydotnet.blogspot.com&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;The title is "Is anyone doing anything HARD with .NET?&lt;br /&gt;I thought he was right on the money.  I would say the answer is "We are NOW!"&lt;br /&gt;&lt;br /&gt;VS.NET 2005 promised to make our life easier and that actual code is greatly reduced.  But, what they don't tell you is the saved coding time is reallocated to trying to tweak their controls to do what you want.  And they make it look so easy in the demos...&lt;br /&gt;&lt;br /&gt;I've reported 3 bugs I've found already with VS.NET 2005.  The above link has some more.   It makes me want to jump ship to the Java camp, but that's not what pays the bills.&lt;br /&gt;&lt;br /&gt;The items I found were:&lt;br /&gt;&lt;br /&gt;1.  ASP.NET: If you comment out a control in the html view of a web form and create a new control with the name of the old one, the compiler still picks up the commented control and lists an error.  On Microsoft's website it says its designed this way.&lt;br /&gt;&lt;br /&gt;2.  ASP.NET: The Textbox control "MaxLength" property does not work if "Multiline" is set to true.  Again, by design.....  Yeah right.&lt;br /&gt;&lt;br /&gt;Bug workarounds:&lt;br /&gt;1.  VB.NET: If your design view for a form refuses to display, showing a list of variables missing you know are in place, simply hit F7, go to anyword hit spacebar and then backspace and hit F7 to return to designer.  It amazingly figures out that the missing variables DO exist.&lt;br /&gt;&lt;br /&gt;Hope this helps someone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30054920-115091444384722942?l=codemonkeyjas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyjas.blogspot.com/feeds/115091444384722942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/docking-in-vsnet-2005.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115091444384722942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30054920/posts/default/115091444384722942'/><link rel='alternate' type='text/html' href='http://codemonkeyjas.blogspot.com/2006/06/docking-in-vsnet-2005.html' title='Docking in VS.NET 2005'/><author><name>DX Jas</name><uri>http://www.blogger.com/profile/08269048232617030811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_bqVAGqNrmmk/R79iNm6pc3I/AAAAAAAAABg/6SwyTS2P9ww/S220/jas.jpg'/></author><thr:total>0</thr:total></entry></feed>
