|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 02 Apr 2012 09:22 PM |
| But just which ones would be useful...? |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2012 09:25 PM |
The first three.
math.sin(n) math.cos(n) math.tan(n) |
|
|
| Report Abuse |
|
|
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 |
|
|