generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How can I create a cool rotation "algorithm"?

Previous Thread :: Next Thread 
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 01:56 PM
I have a model full of parts; I know how to position them in a circle but I want to make it even cooler. I'm using CFrame and they are anchored anyways. So if you have an idea/code example.. Thanks!


r+://69
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 02:17 PM
try out some spirals


Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 02:22 PM
@Kodran

That's what I'm saying. I know how to do a basic circle around them, and maybe some basic up and down movement, I'm asking for an example of how to do something else that's cool.


r+://69
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 02:29 PM
here's an archimedean spiral i wrote up real quick.
look at the wikipedia page for archimedean spiral for a good explanation

local a=1 --change to turn the spiral
local b=5 --'distance between successive turnings'

for angle=1,360 do --this only does 360 degrees of the spiral, increase to have more
local p=Instance.new("Part",workspace)
p.Anchored=true
p.Size=Vector3.new(1,1,1)

--spirally stuff
local theta=math.rad(angle) --convert angle to radians
local r=a+b*theta --spiral formula
local x=r*math.cos(theta) --convert polar coordinates to cartesian
local z=r*math.sin(theta) --^^^^^^^

p.CFrame=CFrame.new(Vector3.new(x,5,z)) --set pos
end


Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 02:33 PM
here's the result of that example. sorry for mutilating the link


(it's a g-y-a, etc,z-o)

/
13
filter
72
filter
d1
filter
ea
filter
6d
filter
f4
filter
88
filter
bd
filter
b3
filter
9c
filter
7f
filter
75
filter
58
filter
23
filter
2c
filter
50


Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
31 Aug 2016 02:33 PM
To add to Kodrans point, you could look up parametric equations. Some real neat graphs.
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 02:36 PM
here's the link in a better way:
local tab={104,116,116,112,115,58,47,47,103,121,97,122,111,46,99,111,109,47,49,51,55,50,100,49,101,97,54,100,102,52,56,56,98,100,98,51,57,99,55,102,55,53,53,56,50,51,50,99,53,48}
print(string.char(unpack(tab)))


Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 02:38 PM
@Kodran
Thanks.


r+://69
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
31 Aug 2016 02:38 PM
I don't think anyone is going to work that hard for a screenshot lmao
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 02:43 PM
not my fault the filter is a poopyhead :c


Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
31 Aug 2016 02:44 PM
Yeah, it's a pain.
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 02:55 PM
How can I make this more efficient?

#code
local TabletOffsetX
if (TabletCount <= 6) then
TabletOffsetX = 5
elseif (TabletCount <= 15) then
TabletOffsetX = 4
elseif (TabletCount <= 22) then
TabletOffsetX = 3.5
elseif (TabletCount <= 28) then
TabletOffsetX = 3
elseif (TabletCount <= 35) then
TabletOffsetX = 2.5
elseif (TabletCount <= 43) then
TabletOffsetX = 2
elseif (TabletCount <= 50) then
TabletOffsetX = 1.5
else
TabletOffsetX = 1
end


#code print("420 mlg noscope rekt!!")
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 03:02 PM
it's not inefficient, just ugly. you could potentially do like

x={{6,5},{15,4},{22,3.5},{28,3},{35,2.5},{43,2},{50,1.5}}

for i,v in pairs(x) do
if tablecount <= v[1] then
tableoffsetx=v[2]
break
end
end

probs not the best way tho idk im lazy


Report Abuse
nooneisback is online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
31 Aug 2016 03:05 PM
@Remastered I pitty the one who'll have to work with you one day...
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
31 Aug 2016 03:06 PM
local angle = 5
Part = Instance.new("Part", workspace)
Part.Anchored=true
while wait() do
Part.CFrame = CFrame.new(0,0,0) * CFrame.Angles(0, 0, angle) * CFrame.new(2, 0, 0) angle = angle + math.rad(99)
end

I like to call this one.. "Mr. Flappy"


Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
31 Aug 2016 03:07 PM
you might wanna add another one that's math.huge,1 so if it's larger than all the others it gets set to 1


Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
31 Aug 2016 03:15 PM
Lol I'll take that and do something better, 1 sec


Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
31 Aug 2016 03:17 PM
@Bern
No. I know how to make orbs, were talking something different entirely.

@Kodran
Thanks.

@Noone
1. No one will work with me, I fly solo.
2. Why do you hound me? Get out you stupid troll.


#code print("420 mlg noscope rekt!!")
Report Abuse
nooneisback is online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
31 Aug 2016 04:59 PM
Nevah! :3
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
31 Aug 2016 05:04 PM
"@Remastered I pitty the one who'll have to work with you one day... "

I pity your English teacher.


All these questions have driven me into existential angst and I find myself beginning to question myself and my motives
Report Abuse
nooneisback is online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
31 Aug 2016 05:07 PM
My grammar is turned off when I'm on the forums, not to forget that I'm often on during midnight.
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
31 Aug 2016 05:12 PM
"during midnight"

uhhh

Report Abuse
nooneisback is online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
31 Aug 2016 05:35 PM
I have some friends over, OK? They don't sleep until 3 am and we run LAN parties.
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
01 Sep 2016 10:07 PM
x = 0
stairs = 300000
length = 1
width = 6
radius = 25
distance = 10

for j = 1, 2*radius/(distance*stairs) + 1 do
for i = 1, stairs do
local t = Instance.new("Part")
t.Parent = game.Workspace
t.Size = Vector3.new(length, 1, width)
t.Anchored = true
t.CFrame =(CFrame.fromEulerAnglesXYZ(0,x,0)+Vector3.new(radius*math.sin(x),distance*2*x,radius*math.cos(x)))
wait(0.02)
x = x+math.rad(length*2.5)
end
end


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image