Rotate board with objects on top

Started by
9 comments, last by BornToCode 11 years, 2 months ago

Hi!

I've created a board game. I want to be able to rotate my board with all the objects on top.

The problem I'm having is that when I rotate the board the objects on to seem to stay still.

I've added physics to it using Bullet Physics engine but don't know how to proceed.

Please help.

Examples would be appreciated.

Advertisement

You want Physics for a board game? We must have a different mental picture of what a board game is... If you are trying to rotate the board to show a different perspective of the board, I would think of that as "moving the camera". If you want the pieces to actually be accelerated outwards because of centrifugal force then, sure, do it with a Physics simulation.

I'm new at this. What I want to achieve is to be able to rotate my board and all the objects on top should rotate with the board.

Like chess, if I rotate the board all the pieces should follow the rotation of the board.

The way it is now for me is that the board rotates but the objects on to stay still. Looks weird.

Maybe I don't need physics at all. But how can I achieve this rotation ??

As I said: By moving the camera. How are you currently rendering the board?

I created my board using Blender, imported it to my game.

Then in my render method I draw everything.

Here I wanted to just rotate for testing purpose.

So the only way to make it look like you rotate the board with everything on it is my rotating the camera ?

No, you can rotate everything. Just apply the same rotation to the board and to the pieces. I don't understand where your first attempt went wrong.

I just rotated the board object. I thought that the objects on top would follow the board automatically somehow but they didn't. So that's where I'm at.

Well, if your scene is organized as a tree where the board is the parent of all the pieces, rotating just the board should work. If they are disconnected objects, rotate them all.

here's my guess:

your current update order for objects:

1) update pieces

2) set the rotation matrix

3) update board

Since the rotation is taking place AFTER the pieces have been updated, the board is the only thing moving

set it up such that:

1) set the rotation matrix

2) update pieces

3) update board

However, my guess is that you should actually be doing more what Alvaro said -- rotate the camera position and keep the board / pieces where they are

Yeah, I'd rotate the camera too ;) Or else have the piece positions relative to the board (so apply the board transform and then the piece transform to get the world space transform).

If that fails increase the friction on the base of the pieces so that they don't slide about as much when the board rotates. And give them a low centre of gravity so they don't topple over. But don't spin the board too quickly ;)

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

This topic is closed to new replies.

Advertisement