3d camera

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
dueyftw
Posts: 2184
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY
Contact:

3d camera

Post by dueyftw »

How do I get the camera to roll behave like the one on the 3d preview?

Dale
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

If you mean orbit, I guess you could make say 4 or 6 key camera positions with matching rotations.
I'm not sure if that's what you mean though.
User avatar
dueyftw
Posts: 2184
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY
Contact:

Post by dueyftw »

In the 3d preview layers track according to their position to the view, closer layers and objects move faster. The 3D camera setting the layers seem to slide no matter how close or far away from the camera. It would really be nice if the 3d preview was a rendering camera.

Dale
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Turn on 3D camera in the project settings. Then set the layers Z position with the layer translate tool. Layers closer will now move "faster". If 3D camera is not on the layers are not effected by Z translation.

-vern
User avatar
dueyftw
Posts: 2184
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY
Contact:

Post by dueyftw »

That not what I'm after, with 3D camera the layers orbit around the camera. They stretch on the edge.

With the 3D preview the camera orbits around the layers.

Dale
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

With the 3d camera turned on, the layers rotate around their origins. The camera is "fixed" and orbits around "itself". What you want is a camera that would change location AND rotation. Even 3D software doesn't really do that with a "camera" object.
In the 3d preview layers track according to their position to the view, closer layers and objects move faster. The 3D camera setting the layers seem to slide no matter how close or far away from the camera. It would really be nice if the 3d preview was a rendering camera.
I thought you were looking for some kind of automatic 3D plane tracking. Like a foreground, middle, back ground kind of thing. My mistake.

-vern
User avatar
dueyftw
Posts: 2184
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY
Contact:

Post by dueyftw »

Yes, that's it. A camera that orbits around and points at center point. Most 3d software does this. AS is doing it on the 3D preview. Why can't I get it as a camera?

Dale
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

The camera is animated. Normally you don't want it to spin around the view area like the "work space" view does. If it did this it would key both the rotation AND the translation. Rotating around the layer would require changing the X Y Z POSITION of the camera not just the rotation.

Rotations are keyed value but the camera is a 3D object in space. rotating it rotates it around its own center point as it should. Camera translation is a also a keyed value. Mixing the two properties would be kind of of difficult to control.

There's no reason this couldn't be scripted somehow though. It would be very tricky and require extensive 3D tracking to determine the location of the camera during rotations. Plus this would key the camera position and there is only one camera so this could be an issue.

-vern
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

Or a point at script like Vern's....:idea:
I wonder if you could attach the camera to a bone- with a script? Probably not huh.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

I know Mel is very different to lua but here is a turntable example script free off the net.

// TURNTABLE VERSION 1.0
// Copyright (C) 2000 GearCGI Ltd.,
// a subsidary of CGI Inc.
/ Author: D.W. Kim
global proc resetClip ()
//proc to reset the camera clip planes
{
pickWalk -d down;
string $currentCam;
$currentCam = "turntablecam1";
print $currentCam;
setAttr ( $currentCam + ".nearClipPlane" ) 0.1;
setAttr ( $currentCam + ".farClipPlane" ) 200.0;
}

global proc resetRotate ()
{
string $currentCam;
$currentCam = "turntablecam1";
print $currentCam;
setAttr ( $currentCam + ".rotateY" ) 0.00;
}

global proc resetPos ()
{
string $currentCam;
$currentCam = "turntablecam1";
print $currentCam;
setAttr ( $currentCam + ".translateX" ) 0.00;
setAttr ( $currentCam + ".translateY" ) 0.00;
setAttr ( $currentCam + ".translateZ" ) 100.00;
}

global proc closeTurn ()
{
select -cl ;
select "turntablecam*";
delete;
deleteUI turntableUI;
}

global proc resetZoom ()
{
string $currentCam;
$currentCam = "turntablecam1";
print $currentCam;
setAttr ( $currentCam + ".orthographicWidth" ) 10.00;
}

//the meaty, beaty, big and bouncy part of the script
global proc turntable ()
{

//delete any existing turntable windows
if ( `window -exists turntableUI` )
deleteUI turntableUI;
select -cl;
if ( `objExists "turntablecam*"` )
select "turntablecam*";
delete;

//create the turntable camera group it to a null node
string $turn[];
$turn = `camera -p 0 0 100 -o true -n turntablecam -hc "viewSet -s %camera"`;
string $cameraShape = $turn[1];
setAttr ( $cameraShape + ".nearClipPlane" ) 0.1;
setAttr ( $cameraShape + ".farClipPlane" ) 200.0;

//center the pivot point at the origin and look through it.
lookThru $turn[1];
xform -ws -piv 0 0 0;
string $currentCam[];
$currentCam = `ls -sl -ca`;
window -title "Turntable 1.0" -rtf true turntableUI;
columnLayout -adjustableColumn true;
frameLayout -l "Turntable Camera Controls" -la "top" -bs "in" -cll true;
columnLayout;
attrFieldSliderGrp -l "Spin Table" -cal 1 right -min 0.00 -max 360 -at ( $currentCam[0] + ".rotateY" );
attrFieldSliderGrp -cal 1 right -min 0.05 -max 200 -at ( $currentCam[0] + ".nearClipPlane" );
attrFieldSliderGrp -cal 1 right -min 0.05 -max 200 -at ( $currentCam[0] + ".farClipPlane" );
attrFieldSliderGrp -l "Table Zoom" -cal 1 right -min 0.05 -max 50 -at ( $currentCam[0] + ".orthographicWidth" );
rowLayout-numberOfColumns 5 -columnAttach5 "both" "both" "both" "both" "both" -adjustableColumn 5;
//columnLayout -co "left" 140 -rs 5;
button -l "Reset Clip Planes" -al "right" -c "resetClip";
button -l "Reset Rotation" -al "right" -c "resetRotate";
button -l "Reset Position" -al "right" -c "resetPos";
button -l "Reset Zoom" -al "right" -c "resetZoom";
button -l "Close Turntable" -al "right" -c "closeTurn";
setParent ..;
setParent ..;
setParent ..;
showWindow;
I'm probably wasting valuable forum space :wink: by entering this but , it might be interesting to some- makes no sense to me.... :roll:
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I have to look over that script to see if there is anything in it I can use.

This issue is more an AS "render" options issue than a rotating camera issue. I use Animation Master which has been around for 20 years or more. I've also used many other 3D apps. They all had cameras that worked the same way. A camera rotates around it's own center point and it translates based on it's center.

Now most 3D apps have an option for more than one camera and rendering from any view. AS allows for quick renders from the workspace view but you can't export animations from that view. Plus the worksapce view can't be key framed.

Quite honestly... the way the 3d camera works in AS is what I expect. I wouldn't want it to do anything else unless it was an optional switch. Having to deal with all those translation keys would drive me nuts.

---------

Now the idea of linking a camera to a bone sounds promising... but... bones don't have Z rotation or translation so not very useful. The only way to do this is to create a new tool that rotates the camera around some imaginary pivot point or I suppose it could be the location of the origin point of the layer.

Like I said I haven't had a need for this. It's never really come up. I have so many script ideas that would really be useful and this one would take a lot of work... not likely to give it a try. Sorry for that dueyftw.

-vern
User avatar
synthsin75
Posts: 10276
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Yeah, nothing like LUA, Chucky.

But everyone seems to have forgotten about the 'orbit camera' menu script. If you run that then you can see what keyframes it writes on the camera track and pan channels.

But having this run by a layer script with a bones rotation would make for cool Matrix effects with camera facing characters. But I'd have to agree with Vern. I too already have too much on my scripting plate.
User avatar
dueyftw
Posts: 2184
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY
Contact:

Post by dueyftw »

It ok, I'm just going to have to brake down and buy After Effects. Thank anyway.

Dale
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

dueyftw wrote:It ok, I'm just going to have to brake down and buy After Effects. Thank anyway.

Dale
There you go. Buy a $1000 program. It's like killing a mosquito with an elephant gun. ;)

Just kidding... sort of. Whatever gets the job done I guess. However you could rotate/translate the layers instead of the camera. Put a bunch of layer inside a group type layer and move and rotate the layers instead of the camera.

-vern
Post Reply