Unit spining around his orbit?

Status
Not open for further replies.

NourmeusXL

Level 10
Sorry for this but i posted the same question at the wrong place (Warcraft Town Hall,yeah im an idiot dont kill me >.<)

Since im moving tovards realising my project of making a cinematic i would like to implement some uniquness in its action.Now i had an idea for a scene but im missing a key to realising my idea.
Now as you can see in the tittle im asking a very very simple question(althouth i dont know if the answer is just as simple)
Is it possible to make UNIT spin around his ORBIT?
Are there such triggers that i am not aware of?
Please if you could help me please do,and dont tell me about the Object Editor couse i know i can make him in - of angle and such.
Im asking by triggers,if someone knows could you post them on this thread.

Im off to suicide soon

bajaist

Level 5
Did you mean unit spinning around another unit/point? If so, make a periodic trigger to increase (anticlockwise) or decrease (clockwise) angle (a), and use this:

X = Xc + d * cos(a)
Y = Yc + d * sin(a)

where X and Y are final position coordinates, Xc and Yc are position of center of rotation and d is orbiting distance.
JASS:
``````call SetUnitX(unit, X)
call SetUnitY(unit, Y)``````

If you need more than one unit to orbit look at this spell of mine, there's an explanation under kinematics tab for n units.

NourmeusXL

Level 10
Ok im gonna try make this easy-er to explain

As you can see i have a skull on my gate it is actually a peasant before the gate should be opened i want to make him spin to add some + to the enviroment.is that possible and please explain me what should i do in the triggers cuz i didint understand x=xc i suck at math btw

Level 10
Understand me?

Level 23

NourmeusXL

Level 10
made a mistake posted the Image above tvice,so tryed delete it wont delete...i had to put something other

aple

Level 12

I consider posting a useless comment that doesn't help the person and you also do nothing else with that comment is worse then a double post. Personally I think that should also be against the rules but that's just me. If you want to tell them don't double post, you should do it in a PM or some other way that doesn't put another useless comment in the thread...

Anyway, Baja didn't do the best job of explaining it. You need to make two Real Variables and name one X and one Y. Then you do the math he said in a "Set Variable" action, and then finally you use the "Set Unit X/Y Position" action.

To do that math, you do something like...

Set Variable Action...
Set Variable X = ...
Arithmetic...
X of Point (This point is going to be the center of where you want to rotate it on) * Cos(a)

Though I have no idea what "a" is suppose to be in there...

Then the same thing for Variable Y. I don't know if you're turning it with the gate or just spinning it. If you're doing the former, you'll also need to change it's facing. =P

Also, to delete a comment you go Edit->Go Advanced->Check the "Delete Message" box and then just below those boxes there's a "Delete This Message" button.

Also, can you put that image in a HIDDEN tag? Simply, [ HIDDEN=(Whatever you want your Hidden title to be](What you're trying to hide)[/HIDDEN]

NourmeusXL

Level 10
i got brain canser god..didint expect i must use math for this bull****

sniper_zero

Level 3
I consider posting a useless comment that doesn't help the person and you also do nothing else with that comment is worse then a double post. Personally I think that should also be against the rules but that's just me. If you want to tell them don't double post, you should do it in a PM or some other way that doesn't put another useless comment in the thread...

I think they do it intentionally to annoy people.

If I understand you correctly, you just want to make it spin right? As in it just stays in the same place and spins?

If that is what you want, you could probably do it like `SetUnitFacing(Skull, GetUnitFacing(Skull) + 1)`

You might have to modify it's turn rate in the object editor to if you want it to rotate faster.

Edit: I've uploaded a test map. Just start it up and you can see the peasant spinning.

Attachments

• SpinSpinSpin.w3m
16 KB · Views: 59

NourmeusXL

Level 10
ill never make this work >.< sorry im just that stupid..and yeah just make it spin without moving well you understood what i wanted to make but its a long lost idea

Mechanical Man

Level 34
i got brain canser god..didint expect i must use math for this bull****

Thats because dudes above don't know about polar coordinates. It's point with polar offset (you can find in gui), offset is a distance from the center (the sun), while you slowly increase the angle, just don't forget to reset 360 to 0, so you don't get astronomical numbers which would quickly overflow and crash the map.

Now I saw you only need spinning, thats easy, just don't forget to reset the angle

sniper_zero

Level 3
Check the post above. I attached a test map.

And for the record, what you want is not for the unit to "orbit", you want it to "rotate on its axis". The orbit caused confusion there.

NourmeusXL

Level 10
yes rotate around his "axis" i want to make it as if it would look the gate is beeing "activated or opened" ill check the test map hopefully i can make it work ^^

EDIT:this would definetly work but Sniper Zero i want to make him spin like a clock imagine a peasant and hes just standing and add a spin like a normal clock spins understand me,what im aiming at?
If you do could you please make a testmap with that spin

sniper_zero

Level 3
No, I don't get what you mean by spinning like a normal clock.

Can you explain more?

EDIT: Oh, wait. I think I get it now. If that was a peasant, you want to make it spin in a way that the head would touch the ground then go back to the normal position?

NourmeusXL

Level 10
you do know how the clock works the little "thing"(sorry cant remember how its called)spins around the clock and telling you what is the time,so the peasant is the clock and his spinning like the clocks thing you get what im aiming at? im an idiot ik
http://www.animatedimages.org/data/media/137/animated-clock-image-0003.gif
So look its a clock and the little thing is spining around the clock thats how i wanna make my peasant spin if you understand me now?
EDIT:Yess and go all the way beneth the ground and back and so onn ugh such a rough way to explain somethin
you got it now

sniper_zero

Level 3
You mean something like this?

If this is what you want then you're better off asking someone to animate that model instead.

I don't know any functions that can change the roll angle of a unit.

Attachments

• Clock.png
219.6 KB · Views: 157

NourmeusXL

Level 10
Yeah thats what i need :/ but the problem is that the peasant isnt going to keep its model in my map,the skull seal is actually peasant i changed the peasants model,the idea was well i thouth that unit could be forced by a trigger to spin like that and that a doodat cant so i changed peasants model to the skull seal,you can see in the image i posted :/

sniper_zero

Level 3
If you really want it to spin like that then, make mulitple copies of the skull seal in object editor.

Shift click roll angle and change the values to something like -45, -90, -135, -180 and so on.

Then use triggers to replace that unit. It'll look like it was spinning.

NourmeusXL

Level 10
Well it wound't look as good,ill just pm the author or someone else to try in animating the model.

Mechanical Man

Level 34
Say this way:
- you want rotation, like Earth rotates which determines Earth's day?
- or you want revolution, like Earth goes around the Sun, determining a year?

EDIT: lol posts are raining in this thread

NourmeusXL

Level 10
Mechanical i used a clock as an exsample of what kind rotation i need not like a day or a year,just imagine a clock and how it works and you will understand.
I just want a function that makes peasant(or any other unit) touch his head to the ground,goes all the way beneth the ground and comes back and i need it in a loop

Tal'Rarity

Level 25
Use a 360 degree dummy model with 180 animations that changes by 2 per animation. Use custom script to access it then use an integer variable and a timer then just keep running it adding +1 calling the next animation to turn it. That's the only way to do it looking good, its easier then it sounds. Attach the skull seal model to the dummy model as well, you can use triggers or unit ability for that easily enough.

chobibo

Level 22
@Mechanical Man: he wants rotation.

NourmeusXL

Level 10

Status
Not open for further replies.

Replies
0
Views
489
[vJASS] 3D Orbit Math
Replies
12
Views
2K
Replies
9
Views
1K
Replies
6
Views
897
Replies
5
Views
863