Jump to content

Look at Camera Expression


Recommended Posts

In the back of my mind I always wanted to do an expression that will allow you to have your alpha plane face the sun (main light source) for shadows and your image plane to face the camera. Never do get the time to play around like that.

 

As for your question, it's a work around and I hope someone has a better solution because I'm sure this is bother me shortly.

 

Pick your "look at camera expression" in the Object Manager. Then in your Attribute Manager under the "tag" tab you'll see a "change pitch rotation". Turn that off. In your coordinates manager you can then rotate your plane so it's vertical again by adjusting one of the values to 0.

 

If your doing an animation I'm not so sure this will work.

 

I hope that helps you out.

 

Chris

Link to comment
Share on other sites

Chris,

 

You're right about the pitch rotation which I turned off already. What I found is that my Object rotation axis needed to be modified to -Z. that faced the image to the camera. and now it works.

 

For targeting another object like the sun or a light source, just add a target expression and then select the object in the expresso editor. Then it will face that object. This will also work in an animation, ie. if your sun is animated.

 

Thanks for your help.

Link to comment
Share on other sites

I jumped the gun. I already changed the object rotation when I was testing it out here. :ebiggrin: Sorry about that.

 

As for that target expression. I just tried it on a light and a simple plane. The whole plane is perpendicular to the light source with no way to adjust the plane back to vertical. At least with the "look at camera" expression you can turn off the pitch rotation and make the plane vertical again.

 

I must be missing something pretty simple.

 

Chris

Link to comment
Share on other sites

No Chris, I dont think you are missing anything. Short of programming a custom Xpresso Expression, I dont think there is a way of doing this.

I agree that it is important and I think we should put our heads together to get an expression like this created. It shouldnt be to hard.

Link to comment
Share on other sites

  • 1 month later...
Originally posted by Frosty:

No Chris, I dont think you are missing anything. Short of programming a custom Xpresso Expression, I dont think there is a way of doing this.

I agree that it is important and I think we should put our heads together to get an expression like this created. It shouldnt be to hard.

Chris and Frosty,

 

Well I finally got a chance to make an Xpresso expression to point an object (like an image plane) toward a sun's heading. You're right Frosty it was easy. :angecool:

 

Here's a .zip file of the expression and a sample scene Look_at_Sun.zip

 

Here's a .sit file of the same thing Look_at_Sun.sit

 

Let me know if it works for you.

Link to comment
Share on other sites

Thanks Frosty. Haven't seen you here for a while.

 

The Expression looks for the sun object and the shadow plane object. The sun tag will position the sun, then the global rotation of the sun object is transfered to the object's H. Rotation. Very simple.

 

However I did make an improvement today by changing the way the objects are referenced. I made the sun and shadow plane references relative. This way you don't have to open the XPresso editor every time to re-reference the objects.

 

I tried it on a couple of scenes and it seems to work fine. You can also save the expression with the object and all the tags to be loaded into other scenes. This way you can build up a library of image planes with auto tracking image and shadow planes to the camera and sun respectively.

 

Pretty cool. cool2.gif Now I want to start breaking into C.O.F.F.E.E. and write some Plugins.

 

Here's the improved Look at Sun Expression.

Link to comment
Share on other sites

Very cool Ace. The update sounds much improved.

 

Yeah, I 've been away for a while prepping for school. I teach at an architecture school here and September is a crazy month.

 

I wonder now if we can bombine your expression with Paul Everrette Surface Painter to creat a forest in 15 Seconds :D

 

I think your expression could even be adapted to use animated RPC content as well.

Link to comment
Share on other sites

LOL!

 

We're thinking the same thing. I already tried to add an image plane object using surface painter but I couldn't get it to work. I think it might be because I didn't make the plane object editable. I'll have to try that and let you know if I can get it to work.

 

Have you tried any of the cidertank plugins by David Farmer? I haven't had a chance to really try out the demo yet.

Link to comment
Share on other sites

There are two simple ways I know of to add trees to hillside...well any uneven geometry. The first is surface painter by Paul Everette. It costs money but it can randomly "spay" symbols onto any surface. You are right Ace, You have to make the polys editable - otherwise the plug cant make the symbol. The second is a lessor know plug I helped Paul with about 18 months ago. Its called Finger Painter. It allows you to drag clones of an object across a surface. The clones can remain verticle or be tangental to the surface. The cool thing about this plug is that you can place each tree (or rock ect) precisely where you want it. Other features include scale and rotation of each clone and a crazy zoom-orbit thing. I'm not sure if this is available anymore tho.

Link to comment
Share on other sites

Chris,

Add an expression to your shadow plane and open the Xpresso editor by double clicking on the Xpresso tag.

 

Once the expresso editor is open create a custom group by selecting Edit> Create Pool... (From the X-Pool Edit menu). Name it and save it.

 

Now load the Look_at_Sun.xgr by selecting File> Load XGroup...

 

Once that is loaded you can drag the Look at Sun XGroup onto your X-Pool for easy access for any object or project.

 

Sun_XPresso-1.jpg

 

Keep your sun in the main Hierarchy so the "Reference relative will find it. If not select the node and drag it to the reference line. The shadow plane should be nested in a Null along with the image plane. and it will also be found. If not select the object node and drag the object to the Reference line. See below.

Sun_Xpresso-2.jpg

 

Hope this helps.

Link to comment
Share on other sites

As far as I know, Archvision hasnt released one....and I have almost no experience using their products. From what I do understand, their plug simply selects which frame of the animated texture to apply to the sprite plane. With a static plane or a plane directly approaching the camera their textures should be simple to use without a plug. Where it would get difficult, is a situation where the camera orbits a sprite plane. There are a bunch of velocity problems to work out as well I think.

 

The real question to me is "Why havent they released a Plug for C4D?" I have some time today. I'll look into this while I'm rendering tests. If there is no solution I think we should all email them and request a plug.

Link to comment
Share on other sites

Frosty,

 

I met Randall Stevens from Archvision at SIGGRAPH this year and discussed this very topic with him. I understand that Archvision would like to develop a plugin for C4D. I added a request in August, at the Maxon Suggestion page for an RPC Plugin.

 

I see that Archvision is developing one for Maya. It would probably be a good idea to mention this to Maxon if they don't already know about it.

Link to comment
Share on other sites

  • 9 months later...

There is a simple solution to the Look at Camera Expression problem:

 

First put a protection tag to the objects

second put the Look at camera expression, in this way it won´t turn in any way.

 

Third, delete the protection tag (If not it won´t turn to the camera, but it will not change the position after that

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...