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: How do I generate spherical points?

Previous Thread :: Next Thread 
EdduTheArdo is not online. EdduTheArdo
Joined: 16 Mar 2008
Total Posts: 3765
02 Apr 2012 08:05 PM
I've never been good at scripts involving algebraic figures.
How would i go about generating a set of points that would form a simple sphere(at most 60 points)?
Report Abuse
EdduTheArdo is not online. EdduTheArdo
Joined: 16 Mar 2008
Total Posts: 3765
02 Apr 2012 08:22 PM
Going into further detail, if I wanted to generate, for example, 60 bricks in the shape of a sphere, how would I distribute them evenly along that sphere?
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
02 Apr 2012 09:02 PM
I'm too tired to give you the exact math, but do some experimenting with numerical for loops and trigonometric functions such as:

math.cos(n)
math.sin(n)
math.tan(n)
math.asin(n)
math.acos(n)
math.atan(n)
math.sinh(n)
math.tanh(n)
math.cosh(n)
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
02 Apr 2012 09:04 PM
@ElectricBlaze,

Why in the....

Why would you give him all the trigonometric functions to 'experiment' with? sinh, tanh, and cosh would not even be useful here.
Report Abuse
EdduTheArdo is not online. EdduTheArdo
Joined: 16 Mar 2008
Total Posts: 3765
02 Apr 2012 09:06 PM
Experimenting with all the trig functions is what I've been doing, but I haven't been able to figure it out.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
02 Apr 2012 09:10 PM
@MrNicNac - I realize that, but there may be a time when DOES need to use hyperbolic sines, cosines, and tangent, and if that time does come, won't the information be helpful?
Report Abuse
EdduTheArdo is not online. EdduTheArdo
Joined: 16 Mar 2008
Total Posts: 3765
02 Apr 2012 09:22 PM
But just which ones would be useful...?
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
02 Apr 2012 09:25 PM
The first three.

math.sin(n)
math.cos(n)
math.tan(n)
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
07 Apr 2012 10:47 AM
Here's something:


for x = -14,14, .25 do
for y = -14,14, .25 do
for z = -14,14, .25 do

if math.floor(x^2)+math.floor(y^2)+math.floor(z^2)==25 then
p = Instance.new("Part")
p.formFactor = "Symmetric"
p.CFrame = CFrame.new(Vector3.new(x*1.5, y*1.5, z*1.5))
p.Size = Vector3.new(1,1,1)
p.Anchored = true
p.BottomSurface = "Smooth"
p.TopSurface = "Smooth"
p.Parent = game.Workspace
p.BrickColor = BrickColor.new(26)
end

end
end
end
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