Easy Trees (part 3)

For the last of this 3 part series, we’ll build on part 2 by making our trees (or anything else) look at the camera-by rotating those trees in only the Z axis.

This method works equally well for trees or any other object you want to have face the camera (or another object), but only pivot on the Z axis. For example, you can buy collections of photographs (with alphas) of people. You would always want the camera to be facing the flat part of any image, but with people or trees you only want those low poly objects to rotate about the vertical, or Z, axis.

This took me a lot longer to figure out than it should have! :) Thanks to Yayo on the 3ds Max groups for pointing out how this is best done!

1. Start out with a tree or picture of a person, as in part 2 of this series:

screen1.jpg

This should render like this:

screen2.jpg

This is fine if the camera never moves-just face the tree toward the camera and you’re all set. If you need to move the camera around, though, and want to still keep the poly count low, this next approach is for you. We’ll be making 2 more objects: A camera, and a dummy object.

2. The first thing to do is to add the dummy object. This is found under Create -> Helpers -> Dummy. Drag to create it over the object to be constrained:

screen3.jpg

Here you can see we’ve added the Dummy01 object to the scene.

3. A small, but important, step to do here is to align the dummy object with the one we’ll be rendering. Because the idea is to have the visible object “linked” to the dummy object (we’ll do that next), it important to have the pivot points (the places where each axis revolves around) lined up with each other.

If they are not perfectly aligned, the target objecct will appear the wobble, or rotate, about it’s pivot point. The reason? The object that is “linked” to another will rotate about that object (by default). If the pivot points are not aligned, the target object will rotate around the dummy object in a radius the size of the mis-alignment. If this is too confusing, try moving the dummy object after this tutorial to see the effect of not aligning the pivot points.

That said, align the Dummy01 object to the target object, aligning pivot points in all 3 axes:

screen4.jpg

4. Next create a target camera, and place the target anywhere close to the center of the target object. This location isn’t that precise.

Now I should note that in this tutorial we’re keeping the camera pointing at the target object, but if your animation has free cameras, or target points that change, or cameras that look in many different directions, this approach still works. The dummy, and consequently the target, objects will look at the camera (or other object(s) you choose) regardless of whether the camera is looking at them.

screen5.jpg

Here we’ve added Camera01.

5. The first step to linking everything together is to link the target object (a plane in this case) to the dummy object. Click the “Select and Link” icon on the left toolbar. It is the one with the 2 little white boxes and 2 red chain “links” between them. The click & drag the mouse from the target object to the dummy object:

screen6.jpg

Now, unless we change the defaults (which we will do), the target object will move and rotate with the dummy object.

6. Before we contrain the axes of rotation for the target objecct, we’ll apply a “look at” constrint to the dummy object. I’m doing this first so you can see the way the target moves before the axes are restricted.

Select the dummy object, then apply the “look at” modifier (Animation -> Constraints -> LookAt Constraint). You’ll see a dotted line coming from the pivot point of the dummy object leading to your mouse. Move the mouse over the camera we added and click the lefft mouse button.

screen7.jpg

Now there is a light blue line extending from the dummy object part of the way to the camera (showing that the dummy object is “looking” at the camera). If you now move the camera, you’ll see that the dummy object as well as the target object move in all directions in order to keep looking at the camera.

This is not what we want! We only want the target to look in the direction of the camera, not directly at it.

7. To do this, we tell the “linkage” between the target and dummy objects to ignore the X axis rotation when following the dummy. To do this, select the target object. Now view the heirarchy settings between it and the dummy object we linked to earlier by selecting the “Heirarchy” tab (the one that looks like a square with 3 squares conneccted below it with lines), then selecting “Link Info”.

Once you’ve done so, deselect the X checkbox under Link Info -> Inherit -> Rotate:

screen8.jpg

Note: It doesn’t have to be the X axis, because different objects can be modified like this. If you don’t get the results you expect, try deselecting the Y axis. If you have created a non-orthagonal aspect, you may want to try unchecking both the X and Y axes.

8. Now when you move the camera, the target object looks in the direction of the camera, but not directly at it:

screen9.jpg

screen10.jpg

When rendered, the renders look natural even though the camera is almost right on top of the tree plane:

screen11.jpg

Add a shadow map like we did in the earlier tutorials, and this is an extremely convincing tree-even close up. The only thing to be mindful of is that since this “tree” (or people, etc.) is following an object (typically a camera), if you move your camera around a lot, and look at this tree close up, it will be obvious that the tree is not stationary.

This effect, therefore, is for close-in where the camera’s line of sight does not move much, or for a large number of trees that are in the background.

The overall point of these 3 tutorials, though, was to demonstrate ways to create scenes with fewer polys. Any time you can reduce the number of faces rendered it reduces render times. If a complex object is needed, and you can’t bear the time needed to render a “real” tree, you can hopefully use some of these tips.

The complete .max file is here.

Thanks again, Yayo!

Bogus Exception


Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

2 Comments


  1. Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

    Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

    Hey Pat, I read your tutorial since I needed to do this with hundreds of trees. I found a slightly better but similar method: Say I have a hundred trees. I create only 1 dummy and place it under the camera. I link the dummy to the camera and under the hierarchy tab (between the dummy and camera), I only check off X and Y under “Move” in the “inherit” group. Now anywhere I move the camera, the dummy follows only on the xy axis. Moving the camera up, and the dummy just stays still. Now I get all my trees to face the dummy and problem solved. This method, is easier since I don’t have to create a dummy for each tree. Thanks for your tutorial and I hope this can be useful to you.

    – Arash


    Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819
    Reply

  2. Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

    Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

    Arash,
    What a fantastic idea! I had never thought about a lot of trees, just a single one. Actually, it was more of an exercise that a practical application, now that I think about your points! I can also see possibilities with your modular approach, such as if a second camera were added. This wouldn’t upset the scene at all, and allow them both to benefit efficiently.
    A LOT of people come to these articles, so I am sure that others will benefit from your keen insight!

    pat
    :)


    Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819
    Reply

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

Leave a Reply
Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

Deprecated: Function get_magic_quotes_gpc() is deprecated in /homepages/16/d105165054/htdocs/atcp.us/blog/wp-includes/formatting.php on line 4819

Your email address will not be published. Required fields are marked *