Jump to content
Ghost Recon.net Forums

Placing ambient-lights


Recommended Posts

I'm trying to place ambient lights on my map in MAX but since the tutorial says I need at least 1 light per 15x15 meters, and my map being 400x400 meters, I'm looking at placing roughly 700 ambient lights!! :wacko:

No problem....but they also need to follow the contours of the terrain :(

Now, I can set 700 lights with the array tool. But now I need to make them follow my terrain.

Does anyone know a fast way to align my ambient lights (which is a helper-dummy) to my terrain?

Link to post
Share on other sites

Does anyone know a fast way to align my ambient lights (which is a helper-dummy) to my terrain?

here you go:


macroScript Move_to_z category:"Grin tools"

(

fn g_filter o = superclassof o == Geometryclass


fn find_intersection z_node node_to_z =

( 

local testRay = ray node_to_z.pos [0,0,-1] 

local nodeMaxZ = z_node.max.z 

testRay.pos.z = nodeMaxZ + 0.0001 * abs nodeMaxZ 

intersectRay z_node testRay 

)


if selection.count > 0 then

(

target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter

	if isValidNode target_mesh then

	(

	undo "MoveToSurface" on

		(

		not_moved = #()

		for i in selection do

			(

			int_point = find_intersection target_mesh i

			if int_point != undefined then i.pos = int_point.pos

			else

				(

				format "Did not find surface: %  \n" i

				append not_moved i

				) --end if

			)--end i loop

		select not_moved

		)--end undo

	)--end if

)--end if

)

This is a maxscript that will take all the selected nodes (your 700 dummies) and when you click on a surface they will move straight down (in Z axis) until they hit the surface, afterwards they move up 1 m which is a good placement for ambient points.

In max, goto mascript>new script paste the script and hit run. Now you will have a macro installed, you can then go to customize>customize user interface and bind the script to a hotkey or a quad menu so that you easily can use this function. You find the command in the grin_tools category.

Good luck with that map :)

Link to post
Share on other sites

Works like a charm!!

Just saved me 2 days of boring "move up and down dummy one-by-one" ;)

Np. I made the script to do spare myself some hours, I might as well share it so that others can do the same :)

feel free to dump the contents of your drive for all to see.

Thanks!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...