Sign in to follow this  
BroderickCalpe

Rotate board with objects on top

Recommended Posts

BroderickCalpe    231

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.

Share this post


Link to post
Share on other sites
alvaro    21263

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.

Share this post


Link to post
Share on other sites
BroderickCalpe    231

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 ??

Share this post


Link to post
Share on other sites
BroderickCalpe    231

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 ?

Share this post


Link to post
Share on other sites
alvaro    21263
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.

Share this post


Link to post
Share on other sites
IkarusDowned    291

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

Share this post


Link to post
Share on other sites

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 ;)

Share this post


Link to post
Share on other sites
BornToCode    1185

Rotate your camera using the center of the board as your pivot point. That way all the objects on the board including the board will rotate when the camera rotate. No need to rotate each individual pieces.

Edited by BornToCode

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