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 » Scripting Helpers
Home Search
 

Re: Algorithm for a Sphere

Previous Thread :: Next Thread 
Raphael7 is not online. 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 is not online. 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
thewhiteshark is not online. thewhiteshark
Joined: 14 Jun 2012
Total Posts: 212
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 is not online. 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
thewhiteshark is not online. thewhiteshark
Joined: 14 Jun 2012
Total Posts: 212
18 Aug 2013 03:03 AM
You try making one .-.
Report Abuse
Cakins is not online. 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
thewhiteshark is not online. thewhiteshark
Joined: 14 Jun 2012
Total Posts: 212
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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