Maxunderground news unavailable
|Making a HUD animation for 3D studio|
I am having a problem doing something I actually thought I would have no problem doing!
Let me explain and I'm sorry if this is a touch incoherent.. and long.
I have an animation of 2 jet planes 'flying' along splines one chasing the other. In the chasing plane I have a camera mounted in the cockpit where the pilots head would be do allow me to do out of cockpit shots. I also wanted to make use of the HUD. It is in the HUD that my problems start.
For my HUD I am using a 2D avi as an animated texture. I make this 2D avi in a 2 step process. First I have a fixed camera where my pilots camera is, only this camera looks straight through the HUD and see's only what the pilot would see looking through the HUD. With all objects hidden and a pink sphere standing in for my target plane (black background too) I render the animation from the HUD camera view. This generates a image that is mostly black with a pink ball swimming in and out of frame briefly. Using this avi I use after effects (or even max again) to generate the other 2D HUD elements including a target reticle, altitude and speed numbers. Render without my pink ball avi in the BG and I get a nice avi that can be mapped onto my HUD.
Back into my original jet scene I use my new HUD avi as a animated texture on my HUD display and if all works (and it does) as my pilot camera follows the bad guy plane from inside the cockpit and it passes infront of the HUD you see the target marker appear on the HUD and follow the plane around and all the other static and animated HUD elements that I have made in after effects.
Now here is the issue. I want to include a pitch ladder (a indicator that shows how much the aircraft has banked and how far above or bellow the horizon the nose is) and a heading indicator. (I can link images of all these things if required). Initially I tried to make these all in after effects but it became a big pain and I could never get it accurate. THEN I saw a Lightwave scene for sale on Turbosquid that used Lightwave to generate the elements themselves and I could then comp them back on my HUD animation. I thought I had it.. except I can't get MAX to do what Lightwave could do.. Or I should say my ability doesn't match the Lightwave guys' abilities.
If I'm allowed I'll link in the turbosquid link it will show you exactly what I'm trying to do with 3d Studio but failing.
What I am trying to do is use the fixed camera that looks through my HUD to create more than just target markers. I created 3D geometry for the heading indicator and pitch ladder. I thought axis restrictions would do the trick and it does.. to a degree, but my 'geometry' doesn't stay in place or in orientation relative to my HUD camera.. I can't seem to find the magic combinations of axis restrictions or what that will allow me to do what that fellow does with his lightwave scenes.
So I turn to you fellows for help.. Sorry about the length..
read 448 times
7/25/2016 10:17:29 PM (last edit: 7/25/2016 10:17:29 PM)
For the pitch ladder, it's simple. Link it to the camera (or airplane) and in Hierarchy panel > Link Info tab > Inherit rollout, uncheck Rotate X and Y.
For the heading indicator, it's a little more complicated. Bear with me.
First, let's make sure we do it the same way since the setup process might influence the output.
Position a free camera at [0, 0, 0]. Rotate it so that it's horizontal, facing the positive end of the Y axis (90° in X, 0° in Y and Z).
Position your indicator mesh in front of it (0 in X and Z and some positive value in Y). If you need to rotate the geometry, make sure you do it at some subobject level so that the object's rotation values remain all at 0°. Then link the indicator to the camera.
With the indicator selected, go to the Motion panel and in the Assign Controller rollout, expand the Rotation controller, select the Y Rotation controller, click the Assign Controller button and pick the Float Script controller. (The reason for using Y instead of Z is that your object now lives in the camera's space).
The maths part.
In the script controller, create a new variable
cam_tm, use the Assign Track button and navigate to the camera's Transform : Position/Rotation/Scale controller.
cam_tm now refers to the camera's transform matrix.
In the Expression field, type in
degToRad (90 + atan2 cam_tm.row3.y cam_tm.row3.x)
and click Evaluate.
Let me break this down.
In a transform matrix, the first 3 rows are the unit vectors in X, Y and Z respectively, the 4th row being the position. Since a camera faces the negative end of its local Z axis, we use the 3rd row.
We then take the arctangente of the row's Y and X components to get its Z direction. (Depending on where the North is in your scene and/or how the indicator was first oriented, you might have to add something else than 90° to compensate and have the 0 mark facing you when you're facing North.) Then we convert the result to radians as is expected by the controller.
This should work.
Note that I'm not sure whether the camera's transform matrix is returned in world space or in the camera's parent space. That is, once your camera is parented to the plane, you might have to first multiply its transform matrix by the plane's. Or maybe use directly the plane's transform matrix (and link the indicator to the plane instead of the camera).
I'm sure the whole setup could be simplified somehow. I just went with the first brute force thing that came to mind.
Hope this helps. As usual, the explanation sounds a lot more complicated than the actual setup.
read 430 times
7/26/2016 11:03:07 PM (last edit: 7/27/2016 4:02:45 AM)
Thanks! I have had some success with the pitch ladder, but I'm still not 100% satisfied. I will cobble together a test this weekend and post the video.
read 373 times
7/28/2016 6:25:35 PM (last edit: 7/28/2016 6:25:35 PM)