Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

90 degree rotation problem

Archive: 23 posts


I don't know if I'm being stupid or not, but here goes:

I have an object, with an anti grav switch set to 90% dampening and zero buoyancy. On that abject is a rotator. On a controlinator, I have the R1 button connected to a counter set to 1, which resets itself. The R1 button is also connected to a timer which counts backwards, which in turn is connected to the rotator. Now, this logic works fine, but I'm struggling to come up with the exact numbers so it rotates exactly 90 degrees. It either seems to be a bit too much, or not enough.
I was hoping someone has perfected this method and could help me out?

Cheers.
2011-03-22 19:37:00

Author:
Ali_Star
Posts: 4085


Have you tried just using a wobble bolt set to directional? Otherwise you might need some sort of detent either physical or with a tag to insure it stops at the amount you need.2011-03-22 19:45:00

Author:
jwwphotos
Posts: 11383


I struggled with something similar in the Beta.
Instead of using a rotator you can use different gyroscopes.
Do you want it to only rotate 90 degrees once or in a complete circle?

If you want full rotation then place a microchip on the object and then add four gyroscopes.
Set them up facing the four different directions. Then have a four port selector hooked up to each of them (Ordered Up, Right, Down ,Left)
You can then use your input to choose where the object rotates to.

Hope this makes sense.
If not then I'd be happy to show you in create mode.
2011-03-22 20:16:00

Author:
SneakySteve1983
Posts: 121


Basically, I wanted R1 hooked up to a clockwise rotator and L1 hooked up to an anti-clockwise one. Essentially giving you the ability to "grid snap" the object by 90 degrees in either direction.2011-03-22 20:22:00

Author:
Ali_Star
Posts: 4085


Ive just published a copyable level with what you need in there.
Just stick the Microchip on the object and hook up R1 and L1.

http://lbp.me/v/z7r9x9
Theres a link if you want to add it to your queue.
2011-03-22 20:32:00

Author:
SneakySteve1983
Posts: 121


The R1 button is also connected to a timer which counts backwards, which in turn is connected to the rotator. Now, this logic works fine, but I'm struggling to come up with the exact numbers so it rotates exactly 90 degrees.

There's a problem with Timers in that they don't always last as long as they should. A freshly-placed Timer lasts for exactly 4 seconds, but as soon as you change that value (even if you change it back to 4 seconds), then the length of time it actually lasts for is often 1/30th of a second less than it should be. There's a list on the wiki (http://wiki.lbpcentral.com/Talk:Timer) which specifies how many frames (at 30fps) a Timer lasts for, depending on its setting.

Annoyingly, all the most useful lengths of time are wrong, so if you want to generate a pulse lasting for exactly 1 second, create a Sequencer, and stretch out a Battery such that it lasts for 1 second, remembering to leave a small gap at the end of the Sequencer, connect the Battery to the Rotator, and then trigger the Sequencer when you want the Rotator to rotate.

The Speed units on Rotators (and Motor Bolts) are in degrees per second, so it should be fairly straightforward to find settings which work.
2011-03-22 20:34:00

Author:
Aya042
Posts: 2870


Ive just published a copyable level with what you need in there.
Just stick the Microchip on the object and hook up R1 and L1.

http://lbp.me/v/z7r9x9
Theres a link if you want to add it to your queue.

Cheers. Mabe you're not so sneaky afterall, eh?

EDIT: Aya - I was thinking that the timers weren't accurate. I will give your method a try aswell.

Anyway, this is for my second project. I'm yet to finish my first yet! My 2nd will be quite a bit more ambitious. Not sure if I'll be able to pull it off, but I'll give it a go

EDIT again: Steve, I can't edit your level because it contains DLC that I don't have - The Incredibles apparantly.
2011-03-22 20:39:00

Author:
Ali_Star
Posts: 4085


Basically, I wanted R1 hooked up to a clockwise rotator and L1 hooked up to an anti-clockwise one. Essentially giving you the ability to "grid snap" the object by 90 degrees in either direction.

An easy way I found to do this is using Gyroscopes and a selector. Have 4 gyroscopes point in the 4 directions you want. Each one connected to a output of a selector. Then use a direction combiner. Hook your L1 and R1 buttons up to it and hook up it's output to the cyclic input of the selector.
2011-03-23 01:26:00

Author:
timeSlider
Posts: 23


An easy way I found to do this is using Gyroscopes and a selector. Have 4 gyroscopes point in the 4 directions you want. Each one connected to a output of a selector. Then use a direction combiner. Hook your L1 and R1 buttons up to it and hook up it's output to the cyclic input of the selector.

This is a simpler method, which might also be suitable, but can produce a noticable jitter effect when rotating, which you won't get using Rotators.
2011-03-23 10:49:00

Author:
Aya042
Posts: 2870


The Speed units on Rotators (and Motor Bolts) are in degrees per second, so it should be fairly straightforward to find settings which work.

Thanks a bunch Aya! I did not know this...
2011-03-23 11:22:00

Author:
Slaeden-Bob
Posts: 605


then use the four gyroscopes like sneakysteve said, and attach them to a sequencer. Then attach a direction combiner to the cycle input of that sequencer. the positive input of that should give clockwise rotation, and the negative will give counterclockwise.2011-03-23 13:01:00

Author:
tdarb
Posts: 689


I the speed is in degrees per second, in theory I should be able to do this:

Connect a battery to a sequencer, which will be connected to the rotator (set at speed 360). I will set the sequencer "stripe" time to O.5secs. Therefore the default sized battery would be half of that, which = 0.25. This should give me a 90 degrees rotation, right?

I'm guessing the acceleration and deceleration should be set to 100 each?
2011-03-23 17:54:00

Author:
Ali_Star
Posts: 4085


"I'm guessing the acceleration and deceleration should be set to 100 each?"

You would have to otherwise it won't start out at the allotted degrees per second, and will not make the full rotation you require.

I would just set it up to 1 sec per stripe, unless you want action to be faster than this. and do the math accordingly. set speed to 90
2011-03-23 19:47:00

Author:
Unknown User


Therefore the default sized battery would be half of that, which = 0.25. This should give me a 90 degrees rotation, right?

In theory you can't do 90 degrees at speed 360, cos you'd need the input to be active for 7.5 frames, which is impossible.

Closest you can get without messing around with Speed Scale would be either...
Rotator speed = 450
Battery length = 6 frames (2 stripes @ 0.1 secs/stripe)
...or...
Rotator speed = 300
Battery length = 9 frames (3 stripes @ 0.1 secs/stripe)

...although in those cases, you can also use a 0.2-second or 0.3-second Timer, since they're frame-accurate for those times.

Note that the Deceleration only applies when the Rotator is active, which is kinda daft, so you'll need to feed the inverse of the signal feeding the Rotator into another Rotator set to zero Speed.

Or use an Advanced Rotator, ensuring the bottom input is always enabled, but if you do it that way, the Timer approach won't work, as it seems that there's a bug whereby the On/Off and Speed Scale settings both do Speed Scale.

TBH, the Gyro solution might be better - I don't seem to be able to reproduce the jitter problem that occurred in the beta, so perhaps it got fixed.
2011-03-23 19:52:00

Author:
Aya042
Posts: 2870


When I was tinkering with tetris-type movement early after launch, the selector/4 gyros thing worked perfectly for me.2011-03-23 20:21:00

Author:
Thegide
Posts: 1465


I don't seem to be able to reproduce the jitter problem that occurred in the beta, so perhaps it got fixed.

How did this jitter problem manifest? I've found gyros to be perfectly predictable so far (and recommend them for the task at hand fwiw) but perhaps I haven't stressed them enough yet.
2011-03-23 20:32:00

Author:
tameturtle
Posts: 150


I would definitely go with the gyros due to timing issues...the math would be fairly complex using rotators.2011-03-23 20:36:00

Author:
Unknown User


I would definitely go with the gyros due to timing issues...the math would be fairly complex using rotators.

It looks like I'm gonna have to. I tried what I mentioned earlier. Even though the maths should have worked, it was still off slightly. Even if I tried to change the speed of the rotator.... if I put it on 366 for example, it wouldn't be enough..... but 367 was too much. I'd hope they'd be able to patch this. It seems like such a silly issue. Making simple tasks much harder.

Aya - could you please clarify what you mean by "frames"?
2011-03-23 21:14:00

Author:
Ali_Star
Posts: 4085


Aya - could you please clarify what you mean by "frames"?

I believe aya is refering to an animation frame. certain animations take a certain amount of frames to complete.
2011-03-23 21:17:00

Author:
Unknown User


LBP is updating the level state (and ideally the video output as well) 30 times per second, so one frame equals a thirtieth of a second.2011-03-23 21:23:00

Author:
tameturtle
Posts: 150


How did this jitter problem manifest?

Retested using two pieces of material connected by a rod, and the jitter is apparent. The rotational forces are calculated based on the mass of the piece of material the Gyro is attached to, and then applied to the object as a whole, which causes jitter, i.e. it overshoots the destination angle, then accelerates back and forth until the force reaches zero.

Still, the same test-case on a Rotator also fails to rotate the object far enough due to the same problem.
2011-03-23 21:36:00

Author:
Aya042
Posts: 2870


Ah, rods - could it be they are at least partly the cause of this jittery oscillation? It seems the physics engine has a very relaxed view of the constraints on rods. Every time I try to use one in anger it doesn't keep its length once stressed, and if it's told to be stiff you can be sure it won't keep the angle, so I end up using solid glue connections instead.2011-03-23 22:01:00

Author:
tameturtle
Posts: 150


When I was tinkering with tetris-type movement early after launch, the selector/4 gyros thing worked perfectly for me.

I've just tried it now. It's perfect. Thanks fellas, problem solved
2011-03-23 22:43:00

Author:
Ali_Star
Posts: 4085


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.