3d camera
Moderators: Víctor Paredes, Belgarath, slowtiger
3d camera
How do I get the camera to roll behave like the one on the 3d preview?
Dale
Dale
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.
-vern
I thought you were looking for some kind of automatic 3D plane tracking. Like a foreground, middle, back ground kind of thing. My mistake.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.
-vern
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
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
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
by entering this but , it might be interesting to some- makes no sense to me.... 
// TURNTABLE VERSION 1.0
// Copyright (C) 2000 GearCGI Ltd.,
// a subsidary of CGI Inc.
/ Author: D.W. Kim
I'm probably wasting valuable forum spaceglobal 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 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
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
- synthsin75
- Posts: 10276
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
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.
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.
There you go. Buy a $1000 program. It's like killing a mosquito with an elephant gun.dueyftw wrote:It ok, I'm just going to have to brake down and buy After Effects. Thank anyway.
Dale

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