Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

 

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

 
submit tutorial
1 | 2 | 3 | 4
Power Up Your Polygons

| Your Rating:
rating star fullrating star fullrating star fullrating star fullrating star full
(6 Votes)
| 130720 Views
| 5 Comments
| Comments 5
Date Added: 9th January 2012
Software used:

Now that we have the Powergon command attached to the polygon we selected, Save the object and load it into Layout. With the object selected, choose the Convert Powergon command located under the Items Tab in the Add sub-menu. (Items > Add > Cvt Powergons) This command will execute any command scripts that are attached to the selected object.

The default script that we added creates a spotlight named LGON, positions it at the center of the polygon, rotates it to match the polygon's normal, parents the light to the object and creates a keyframe at frame 0 (Fig.04).

Note: Once a Powergon script is executed in Layout, you can clear the object if it is unneeded otherwise. However, the default command parents the lights to the object, so be careful since you don't want to delete the children.

1464_tid_Powergons_003.jpg
Fig.04 - CVT Powergons executes the command we attached to the polygon

Understanding the Default Powergon Command Script

Now that we've seen the result of the Powergon, let's take a closer look at the script and break it into its individual components.

AddSpotlight LGON\rPosition \c\rRotation \n\rParentItem \i\rCreateKey 0

AddSpotlight LGON simply adds a Spotlight to the scene and gives it the name "LGON".
\r is a special "escape" character that creates a line return to signify the end of the current command and the start of the next.
Position \c\r uses the \c special "escape" character to return the position of the polygon's center in the form "x y z". This is used to position the light at the center of the polygon we applied the Powergon to. The \r at the end is used as another line return so we can continue adding commands to this script.
Rotation \n\r uses the \n special "escape" character to return the polygon's normal converted into heading, pitch and bank angles (bank is always 0) in the form "h p b". This rotates the Spotlight to match the polygon normal. Again we use the \r character as a line return.
ParentItem \i\r uses the \i special character. This returns the item ID of the object containing the polygon so we can assign the Spotlight as a child to our object.
CreateKey 0 simply creates a keyframe at frame 0. Note that the \r special "escape" character is not needed at the very end of the last command.

So now we know what the default script does, but where do these commands come from and how many different special "escape" characters are there? Let's start with the special characters since there are only six to work with and we already covered four of them. Here are the six special "escape" characters that can be used when generating a Powergon Command:

\a returns the area of the polygon.
\c returns the position of the polygon's center in the form "x y z".
\d returns the polygon's normal vector as "nx ny nz".
\i returns the item ID of the object containing the polygon.
\n returns the polygon's normal converted into heading, pitch and bank angles (bank is always 0) in the form "h p b".
\r creates a line return to signify the end of the current command and the start of the next. Note that it is not needed at the very end of the last command.

Once you work with Powergons for awhile you'll be able to call these six characters up from memory with ease, but what about the Layout commands? Where do they come from?

Layout Commands

Nearly all of your actions in Layout are executed by sending discrete commands. When you click on the VIPER button (Render > Utilities > VIPER) it sends a command to Layout to open and display VIPER. We can watch what commands are being sent to Layout by using the Command History window found under the Utilities Tab (Utilities > Commands > Cmd History).

Clear the current scene and launch the Command History window (Utilities > Commands > Cmd History)(Fig.05).

1464_tid_Powergons_004.jpg
Fig.05 - Command History Window in Layout

Leave the Command History window open, add a Spotlight to the scene and name it "LGON" (Items > Add > Lights > Spotlight.




< previous page continued on next page >

 
1 | 2 | 3 | 4
Related Tutorials

Character Production in 3ds Max - Chapter 01

by Rodrigue Pralier
published on 2014-08-22

Keywords: 3dsmax, poly modeling, character

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star none (5)
Comments 0 Views 20594

CharacterStudio to Lighwave

by Brent Alleyne
published on 2009-12-09

Keywords: character, lightwave, animation, rigging,

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (1)
Comments 0 Views 49537

What is gMil?

by Isham Padron
published on 2009-12-09

Keywords: gmil, lightwave, surface, shader,, illumination, gi,

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star none (1)
Comments 1 Views 27325

Animated Snow Trails

by Andy Nicholas
published on 2009-12-09

Keywords: animation, snow, trails, lightwave,

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (1)
Comments 0 Views 61094
Readers Comments (Newest on Top)
avatar
Mosley on Wed, 11 January 2012 5:47pm
Good tutorial! 3DT could use more LightWave. Can Luxigons be used with all existing light types, including dome, IES, and spherical lights?
avatar
Glen D on Wed, 11 January 2012 1:26am
Great tutorial as always from William V! Thanks for another Lightwave tutorial, hopefully we can seem more in the future!
avatar
EraserFX on Wed, 11 January 2012 12:28am
Excellent tutorial. Very useful! Thank you
avatar
Cesar Falcao on Tue, 10 January 2012 10:03pm
Very useful tool
avatar
Ryan Roye on Mon, 09 January 2012 8:42pm
Very cool tutorial and I'll definitely be hotkeying this function. This gives me so many ideas for things I can do now that I couldn't before.
Add Your Comment