Drawing Problems

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
xeredent
Posts: 2
Joined: Thu Nov 15, 2012 8:32 pm

Drawing Problems

Post 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)?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Drawing Problems

Post 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).
xeredent
Posts: 2
Joined: Thu Nov 15, 2012 8:32 pm

Re: Drawing Problems

Post by xeredent »

No, I'm not starting with XNA, I know how rendering works :D

Anyway I solved, thanks!
Post Reply