Maxscript / IntersectRay

Maxscript / IntersectRay

Anonymous
Not applicable
1,501 Views
0 Replies
Message 1 of 1

Maxscript / IntersectRay

Anonymous
Not applicable
Hi everyone!

I really need your help about something in Maxscript...

What I want to do is launch a ray from each point helper generated by an 3D array and look if the rays intersect the box named "box01". My problem is: I dont know how to use in loop all point helper position as origin for a ray and then if the ray intersect the box affect its size.

Thank you very much!
Alex

This is the script I did /////////////////////

Box length:22 width:38 height:48 pos:

(
local array = #()
c = 20
global l = 6
global w = 6
global h = 4

ML = (c * L + c) / 2
MW = (c * W + c) / 2
MH = (c * H + c) / 2

for x = 1 to l do
(
array=#()
for y = 1 to w do
(
array=#()
for z = 1 to h do
(
array=Point size:1 pos: wirecolor:
)
)
)

(
for i in (getClassInstances point) do
(
r0 = Ray i.pos -- Ray
IR = intersectRay $box01 r0

(
if IR != undefined do
(
i.size = i.size+2
)
)
)
)
)
0 Likes
1,502 Views
0 Replies
Replies (0)