Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 18 Aug 2013 02:09 AM |
What do I need to do in order to compose an algorithm to create the shape of a sphere? I'm not really sure as well of what methods are to use.
> Trolls are radical hipsters. |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 18 Aug 2013 02:40 AM |
Pretty sure that isn't the term you want to be using there. Or really the method of which you want to either.
Make a part. Go into properties. Change its Shape. |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2013 02:50 AM |
Yay math challenge Close enuf f = -1 for i = 1, 100 do if i <= 50 then Part = Instance.new("Part")Part.Name = i Part.Position = Vector3.new(10,20,10) Part.Parent = game.Workspace Part.Anchored = true Part.Size = Vector3.new(5*i,3,5*i) end if i >= 50 then f = f + 2 Part = Instance.new("Part") Part.Name = i Part.Position = Vector3.new(10,20,10) Part.Parent = game.Workspace Part.Anchored = true Part.Size = Vector3.new(5 * (i - f),3,5 * (i - f)) end end |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 18 Aug 2013 02:56 AM |
| Without even testing that, I am 95% sure that that is both more confusing than it has to be, and wrong, if you were going to make one artificially. |
|
|
| Report Abuse |
|
|
| |
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 18 Aug 2013 03:37 AM |
Sorry I went away for a bit. Anyhoooo. Thanks highschool trig classes.
radius = 5 height = -radius
for a = 1, radius / 0.8 + 1 do for b = 1, 100 do newpart = Instance.new("Part") newpart.Anchored = true
c = (math.pi * 0.1) * b
height = height + 0.02
newpart.CFrame = CFrame.new(Vector3.new(newpart.Position.x + radius * math.cos(c), newpart.Position.y + height, newpart.Position.z + radius * math.sin(c)), newpart.Position)
radius = (25 - height ^ 2) ^ 0.5
newpart.Parent = workspace end end
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2013 04:44 AM |
Nice script but why did you do this? "radius = 5 for a = 1, radius / 0.8 + 1 do" 5 * .8 + 1 is still 5. Trying to make it look more difficult then it already is? |
|
|
| Report Abuse |
|
|
Odjur
|
  |
| Joined: 16 Aug 2013 |
| Total Posts: 1 |
|
|
| 18 Aug 2013 05:49 AM |
| Ehh, I had to define radius at some point. Doesn't really matter where. |
|
|
| Report Abuse |
|
|