Page 1 of 1

Drawing Problems

Posted: Thu Nov 15, 2012 9:26 pm
by xeredent
I've started using bepu from yesterday, and here is my first problem.

Since entities don't have a "draw part", I decided to start trying the Model Drawer of the Demo.

When I change the space (I'm using a superclass named "Cell") it automatically clear and add all the entities to the drawer.
In Draw Method of the MainType I inserted drawer.Draw(view, projection) and in the Update method I inserted drawer.Update(), but nothing happens.

Can you better explain to me how to draw an entity (also if not with the drawer)?

Re: Drawing Problems

Posted: Thu Nov 15, 2012 9:46 pm
by Norbo
Creating an InstancedModelDrawer, adding entities to it, calling its Update method in your update, and calling its Draw method in your draw should be all that is needed. If that does not work, make sure the entities are where you expect them to be and make sure that the correct view/projection matrices are being passed in.

Note that graphics are completely separate from the physics simulation. You can use any method to represent the physics visually. If you'd like to learn more about rendering, there are a lot of great sites out there (if you're using XNA, starting with the XNA educational samples would be a good option).

Re: Drawing Problems

Posted: Sun Nov 18, 2012 3:46 pm
by xeredent
No, I'm not starting with XNA, I know how rendering works :D

Anyway I solved, thanks!