Jump to content
  • Advertisement
Sign in to follow this  
BroderickCalpe

Rotate board with objects on top

This topic is 1946 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

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

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.

Share this post


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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!