Sign in to follow this  

Create multiple 3d model object at derived class

Recommended Posts

Hi, I try to create multiple object in XNA 2.0. I create LampManager class(derived from game1.cs and pass graphicdevice, content from game1.cs) and Lamp class and try to create multiple lamp(3D Model) object, because I don't want to put all the code in game1.cs. But When I move drawmd2model() function to LampManager or Lamp, the effectpass, verdexdeclaretion got error... throw null exception, ..."pass" same scope in parent error.... I want the Lamp class got their update and draw function and effect(draw at Lamp.cs). the LampManager (run the Lamp.Draw() and Lamp.Update())is to manage the Lamp class. In the game1 class(run the LampManager.Update()) Does anyone know how to do it ? And, is it the effect, shader and draw 3d model functions only can put in the game1.cs, other than the game1.cs it will get error ? Thanks.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this