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

Rotate 90 degrees

Archive: 7 posts


Hi guys.
I'm playing around in my level now with rotators and rotation sensors. I have a round piece of sticker panel material with an arrow sticker on it. I also have two buttons. What I'm trying to do is. When I press the left button, the arrow rotates exactly 90 degrees left. If I press the right button, it rotates exactly 90 degrees to the right. So if it's pointing up and I press the right button, it will be facing right. But if I press the right button again, it will face down.

Does anyone know a solution to this? It's my first time playing with rotators so I'm not really familiar with these tools

Thanks alot everyone
2012-11-07 23:23:00

Author:
Unknown User


It's difficult to tell what your logic looks like exactly, but if you are trying to get things to rotate at exactly 90 degree intervals, I would use a couple gyroscopes rather than rotators and angle sensors.

After trying to read very carefully what your problem is, what I understand is that you want to only have three different rotation states (top, left, right), and you don't want it to be upside down at all.

Since it seems like you are using rotators and sensors rather than gyroscopes (I would definitely use gyroscopes, as it would be much easier) I would just disable the input from the right button with an AND gate when the sticker panel is facing right and vice versa for the left side.
2012-11-07 23:57:00

Author:
ChrisF2112
Posts: 265


Hi ChrisF2112,

Thanks alot for replying! Although I think I should have more clearly stated what I wanted. I do want the arrow to be pointing upside down if rotated enough. Basically I want to be able to rotate the arrow Left 90 degrees, or Right 90 Degrees. It can rotate as many times as the button is pushed but my problem is just getting it to rotate exactly 90 Degrees whenever the Rotate Left or Rotate Right button is pushed.

When I read the description for the Gyroscope it says it's used to prevent the object from rotating as much as possible. Can this tool be used to spin the object around? Is it a bad idea to try to use Rotation Sensors and Rotators to try and accomplish what I am trying to do?
2012-11-08 05:55:00

Author:
Unknown User


The Rotation Speed used in LBP2 and LBPV is actually defined as "Degrees of Rotation per Second". So if you have a Rotator and set it to 360, the Rotator will rotate 360 degrees in 1 second. Set the Rotator to 90 and it will only rotate 90 degrees in 1 second.

To make it rotate in 90 degree increments I would therefore connect a Timer to a Rotator. A Timer set to Start Count Down for .1 second wired to a Rotator set to 900 Rotation Speed, will generate a 90 degree rotation in .1 second.

To make you setup account for both left and right rotation is slightly more complicated, but not by much
Making you system not mess up when alternating between left and right in rapid succession is somewhat more complex, but still entirely possible


Edit:
I have attached an image showing a possible setup on how to achieve both left and right rotation, without being able to mess it up. I realise that the image quality is not the best, but hopefully it can still be of some use to you...
http://i9.api.vita.lbp.me/img/ft/1e90a577aa9669f543c052996d836658c49fe5aa.jpg
You can find a description in the Spoiler below.
1) The grey wire entering from the upper left is the Up/Down signal from the Left Analogue Stick.
2) The signal is split into a positive and negative component at the yellow Signal Splitter. These two components are used to decide if the arrow rotates left or right.
3a) The positive signal component enters port1 of a Selector in the upper blue circuit. The following Timer(T) is set Start Count Down for .1 second.
3b) The negative signal component enters port1 of a Selector in the lower green circuit. The following Timer(T) is also set Start Count Down for .1 second.
4) This red sub-circuit serves to exclude the positive signal when the negative is active, and vice versa. The OR Gate is Inverted, and the signal is passed onto the Counter, but also the Selector in 5. The Counter(C) is a 1-Step with the Output wired into its own Reset. The Timer(T) used is set to Start Count Down for .2 seconds. The signal from the Counter is finally wired back into port2 of the Selectors in 3a and 3b.
5) The final yellow sub-circuit begins with a 3-port Selector making sure constant signals are generated whenever the Timers in 3 are active. The positive signal goes into port1, the negative signal into port2 and port3 serves as the "off state" when neither positive or negative signals are received. The positive and the negative signal is re-combined in a Signal Combiner before it is finally sent to the Rotator(R). This Rotator is set to Speed Scale with a Rotation Speed of 900, and an Acceleration/Deceleration of 100%.

Note: Make sure the Current State of every Selector is as "high" as possible (i.e. 2 in sections 3a and 3b and 3 in section 5), to avoid jerky movement of the arrow when you unpause.
The above circuit might not be completely optimised, but it will get the job done
2012-11-08 09:40:00

Author:
Slaeden-Bob
Posts: 605


Hi ChrisF2112,

Thanks alot for replying! Although I think I should have more clearly stated what I wanted. I do want the arrow to be pointing upside down if rotated enough. Basically I want to be able to rotate the arrow Left 90 degrees, or Right 90 Degrees. It can rotate as many times as the button is pushed but my problem is just getting it to rotate exactly 90 Degrees whenever the Rotate Left or Rotate Right button is pushed.

When I read the description for the Gyroscope it says it's used to prevent the object from rotating as much as possible. Can this tool be used to spin the object around? Is it a bad idea to try to use Rotation Sensors and Rotators to try and accomplish what I am trying to do?

The gyroscope will turn an object to face in a certain direction, so it is exactly what you want. The best solution to this will be extremely easy. Although what is above would work, it is probably more complex than the solution below (Although I don't have a picture).

Put the signal from your buttons into a signal combiner, then put the signal combiner signal into the selector cycle input. Have 4 gyroscopes attached to the selector outputs (the selector must have 4 different outputs) and rotate each one 90 degrees more than the previous gyroscope was. That will do exactly what you want.
2012-11-08 14:37:00

Author:
ChrisF2112
Posts: 265


Woah. I've never received such awesome feedback on a problem before.. Thanks so much guys, I've learned alot from both your posts. I'm going to try both of these and see what works best for my situation.
Thanks again so much I appreciate it
2012-11-08 19:48:00

Author:
Unknown User


Thanks again so much I appreciate it

Any time

Henshin-a-go-go baby!
2012-11-08 22:18:00

Author:
Slaeden-Bob
Posts: 605


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.