Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delete Shapes
- delete $lbBox*
- delete Helpers
- --try (delete $lbPointObj)catch()
- deleteAllChangeHandlers id:#lineBomb
- with undo off
- (
- amtBoxes = 100
- numSegs = 5
- minPos = -100.0
- maxPos = 100.0
- innerCircle = 0.0
- lenLine = 200.0
- lbPoint = Point pos:[0,0,0] cross:on size:10 name:"lbPointObj"
- for i = 1 to amtBoxes do
- (
- box position:[random minPos maxPos,random minPos maxPos,random minPos maxPos] length:5 width:5 height:5 wireColor:blue name:"lbBox"
- )
- Fn ShpFmArr shpInterp shpPosArr col =
- (
- newShape = splineshape wireColor:col
- newSpline = addnewSpline newShape
- for myKnot in shpPosArr do
- (
- addKnot newShape newSpline shpInterp #curve myKnot
- --#corner, #smooth, #curve
- )
- updateShape newShape
- )
- Fn LineBombOperation =
- with undo off(
- delete Shapes
- gSphere = (createInstance GeoSphere position:lbPoint.position radius:1 segs:numSegs name:"test")
- vecArr =#()
- for i = 1 to (getNumVerts gSphere.mesh) do
- (
- append vecArr (getVert gSphere.mesh i)
- )
- for i in vecArr do
- (
- firstPnt = (i*innerCircle)+lbPoint.position
- shpPosArr = #(firstPnt)
- myRay = ray (gSphere.position) i
- hitPoint = intersectRayScene myRay
- if hitPoint.count > 0 then
- (
- append shpPosArr hitPoint[1][2].position
- ShpFmArr #corner shpPosArr red
- ) else
- (
- if (random 1 7) == 1 do
- (
- append shpPosArr (i*lenLine+lbPoint.position)
- ShpFmArr #corner shpPosArr yellow
- )
- )
- )
- )
- when transform lbPoint changes id:#lineBomb do LineBombOperation()
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement