Notifications
Clear all

[Closed] shorter way to do this?

is there a shorter way to do this but get same results?


rotate a (angleaxis -6500.0 [0,1,0])
[size=1]rotate b (angleaxis -6500.0 [0,1,0])
[size=1]rotate c (angleaxis -6500.0 [0,1,0])
[size=1]rotate d (angleaxis -6500.0 [0,1,0])
[size=1]rotate e (angleaxis -6500.0 [0,1,0])

im a super noob, so if you could please reply SLOWWLY…lol.

thanks guys

[/size][/size][/size][/size]

4 Replies
1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

Looks like a job for a FOR loop. The question is – what are a,b,c,d,e and where they come from ? Actually, you cannot use “e” as variable, as it is a reserved keyword!

The above could be written as


 theArray = #(a,b,c,d,f)
for i in theArray do rotate i (angleaxis -6500.0 [0,1,0])

Hope this helps.

WORKED!

thanks Bobo…

i just uesed abcde as an example… (sorry forgot e was reserved)

anyway…works well now…thanks a bunch

btw…my prof. was telling me about you…i think he knows you or something…not sure…but i found it kinda funny that i was on your website, and the nextday, he mentioned you.

thanks man.

1 Reply
(@hmarandi)
Joined: 1 year ago

Posts: 0

wait…it didnt’ work…i forgot to comment out the old way (long way). it doesn’t give any errors, but wont do anything.

basically ABCD are my shapes, and i want a loop to make them rotate .
the way i did it above works ok, but i thikn there is a way to do it more efficiently, i just dont’ know how.

thanks

GAH…IM AN Noob, it does work. i did this and it worked

 
animate on 

(

sliderTime = 300f

array = #(a,b,c,d)

for i in array do rotate i (angleaxis -1600 [0,1,0]) 

)

set animate off