Message 1 of 1
Maxscript / IntersectRay
Not applicable
11-07-2010
10:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
)
)
)
)
)
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
)
)
)
(
for i in (getClassInstances point) do
(
r0 = Ray i.pos -- Ray
IR = intersectRay $box01 r0
(
if IR != undefined do
(
i.size = i.size+2
)
)
)
)
)