playMaker

Author Topic: How to rotate an object, when tilted?  (Read 4295 times)

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
How to rotate an object, when tilted?
« on: December 27, 2013, 01:44:53 PM »
hi there,

I want to rotate an object by it´s Y-axis and X-axis. I setup two GUI sliders, the rotate/tilt my object.

Now - I want to rotate the object on the Y-axis like it is put on a turntable.
That works ok, when I did no rotation on the X-axis, but when I "tilt" on X, Y rotates (still) around Y, but not like spinning around itself, but tilted...

Damm, kind of hard to explain for me...

I hope, you get what I mean


parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to rotate an object, when tilted?
« Reply #1 on: December 27, 2013, 03:47:20 PM »
Rotate Y on an empty GO which the object is parented to?

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #2 on: December 27, 2013, 03:59:49 PM »
hmm, I dont know what you mean by that...

should I create an empty GO and make it child of my mesh (the GO that I want to spin)??

parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to rotate an object, when tilted?
« Reply #3 on: December 27, 2013, 04:16:27 PM »
No the other way around. Make your object a child of the empty GO, so that they can rotate independently. The empty GO, could even have other empty GO's as children and eventually the real object as 'grandchild',  that's how I think you would do a gyro type thing with different rotational axis's. At least that's how I understood what you were trying to do.

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #4 on: December 27, 2013, 04:24:18 PM »
Ah, I see ;)

I made my mesh an child of an empty GO - now, it "orbits" in the scene...

but I want it to turn around it´s center, without moving... like turning around in place an keeping this turning, when tilted in X-axis.

parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to rotate an object, when tilted?
« Reply #5 on: December 27, 2013, 04:30:38 PM »
Did you place the empty GO (pivot) at the same coordinates as your object? Easiest to do this before parenting and easier still if all are at 0.0.0

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #6 on: December 27, 2013, 04:36:00 PM »
Yes, I did... but what´s the difference, if choosing empty GO instead of the mesh directly? It behaves the same now...

basically, I want something like this:

http://www.qt-ent.com/PlayableDemos/DesertTerrain/

parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to rotate an object, when tilted?
« Reply #7 on: December 27, 2013, 04:42:48 PM »
That example is based on an orbiting camera around a center point, and not the object rotating.

Edit: This is false, it's a rotating object  ::)
« Last Edit: December 27, 2013, 05:51:51 PM by parallel »

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #8 on: December 27, 2013, 04:44:03 PM »
hmmm, can you give a hint, on how to setup something like this?

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #9 on: December 27, 2013, 04:46:58 PM »
Aaaahh, just the same way, you stated above ;)

- OK - not quite right 

parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to rotate an object, when tilted?
« Reply #10 on: December 27, 2013, 04:56:15 PM »
I'm working on an example, not sure how to export it yet.

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #11 on: December 27, 2013, 05:15:09 PM »
Wow, that´s very kind!

maybe just make some screenshots?




parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to rotate an object, when tilted?
« Reply #12 on: December 27, 2013, 05:17:39 PM »
Here's a scene (as opposed to a package), hope it can be read by you and that it's what you mean.

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to rotate an object, when tilted?
« Reply #13 on: December 27, 2013, 06:13:21 PM »
AWESOME !!! :D

I tweaked it a bit and now - it´s pretty much the solution, I was looking for !

cheers
« Last Edit: December 27, 2013, 06:36:11 PM by Onkelpoe »