Loading a model


Only a couple of changes to get this tutorial up and running in XNA 4.0

In the LoadModel() function we need to change the line:

meshPart.Effect = effect.Clone(device);

and remove the device parameter since this is no longer necessary:

meshPart.Effect = effect.Clone();

And change the technique to the new one that we wrote in the custom shader to use the one which accepts vertex data with normal data so change this:

currentEffect.CurrentTechnique = currentEffect.Techniques[“Colored”];

to this:

currentEffect.CurrentTechnique = currentEffect.Techniques[“ColoredNormal”];

So that’s all for this one, short and sweet eh! Next step ambient and diffuse.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s