Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Rotate board with objects on top


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Hachaso77   Members   -  Reputation: 231

Like
0Likes
Like

Posted 21 February 2013 - 03:36 PM

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.



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13628

Like
1Likes
Like

Posted 21 February 2013 - 04:14 PM

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.



#3 Hachaso77   Members   -  Reputation: 231

Like
0Likes
Like

Posted 21 February 2013 - 04:26 PM

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



#4 Álvaro   Crossbones+   -  Reputation: 13628

Like
1Likes
Like

Posted 21 February 2013 - 04:33 PM

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



#5 Hachaso77   Members   -  Reputation: 231

Like
0Likes
Like

Posted 21 February 2013 - 04:45 PM

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 ?



#6 Álvaro   Crossbones+   -  Reputation: 13628

Like
0Likes
Like

Posted 21 February 2013 - 04:49 PM

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.



#7 Hachaso77   Members   -  Reputation: 231

Like
0Likes
Like

Posted 21 February 2013 - 04:57 PM

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.



#8 Álvaro   Crossbones+   -  Reputation: 13628

Like
0Likes
Like

Posted 21 February 2013 - 06:27 PM

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.

#9 IkarusDowned   Members   -  Reputation: 291

Like
0Likes
Like

Posted 21 February 2013 - 06:27 PM

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



#10 Paradigm Shifter   Crossbones+   -  Reputation: 5405

Like
0Likes
Like

Posted 21 February 2013 - 06:38 PM

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

#11 BornToCode   Members   -  Reputation: 935

Like
0Likes
Like

Posted 22 February 2013 - 01:10 AM

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, 22 February 2013 - 01:11 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS