Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Featured Threads
  inspiration alert!!!
(36 replies)
  Indespensible MaxScripts, Plugins and 3rd Party Tools
(37 replies)
  The allmighty FREE Resources Thread !
(17 replies)
  spam alert!!!
(4886 replies)
  Maxforums member photo gallery index
(114 replies)
  Maxforums Member Tutorials
(89 replies)
  three cheers to maxforums...
(240 replies)
  101 Things you didnt know in Max...
(198 replies)
  A Face tutorial from MDB101 :D
(95 replies) Members Gallery
(516 replies)
(637 replies)
  Dub's Maxscript Tutorial Index
(119 replies)

Maxunderground news unavailable

First page  Go to the previous page   [01]  [02]  Go to the next page  Last page
formula conversion
show user profile  killerbee2
My math is terrible apparently, can someone extract the fov out of this ?

so you get fov= formula.

tnx in advance.
By the way, it's the maths behind the optimal vertigo effect.

read 1017 times
2/28/2011 2:37:33 PM (last edit: 2/28/2011 2:39:16 PM)
show user profile  Nik Clark
I think it's:

distance = width/((2*TAN)*(FOV/2))

I could be wrong. I am not good with numbers.

read 1009 times
2/28/2011 2:40:23 PM (last edit: 2/28/2011 2:40:23 PM)
show user profile  BishBashRoss
Cool stuff. One of you script guru's should make a script!

read 1005 times
2/28/2011 2:42:04 PM (last edit: 2/28/2011 2:42:04 PM)
show user profile  Nik Clark
There was a Vertico script many years ago, made by a member here. Scriptspot turned up nothing, so it must have been a really long time ago.

read 998 times
2/28/2011 2:46:41 PM (last edit: 2/28/2011 2:46:41 PM)
show user profile  advance-software

If you just want that formula re-arranging.

fov = 2* atan(w/(2d))

Working :

d = w / (2 * tan(fov/2) )

[invert both sides]
1/d = (2 * tan(fov/2)) / w

[multiply both sides by w/2]
w/(2d) = tan(fov/2)

[take inverse tangent of both sides & reverse equality]
fov/2 = atan(w/(2d))

[multiply both sides by 2]
fov = 2* atan(w/(2d))

read 995 times
2/28/2011 2:47:28 PM (last edit: 3/1/2011 9:52:09 AM)
show user profile  killerbee2
no on there AS,

basicly what the effect does is for example is moving the camera backwards while zooming in resulting in the focussed object remaining the same height while the background distorts.
Hitchcock was one of the first to use it in the film Vertigo, hence why it's called the vertigo effect.

The problem is that you need a curve to make it appear perfect which should be based on the formula above to maintain a steady movement.

So the easiest way to make it happen would be inserting a formula into the FOV that changes according to the distance of the focal targetpoint.

read 976 times
2/28/2011 2:55:20 PM (last edit: 2/28/2011 2:55:20 PM)
show user profile  advance-software
I've edited the post - you wanted the formula re-arranging to give you the fov ?

If so, I've done that for you.

read 972 times
2/28/2011 2:59:13 PM (last edit: 2/28/2011 3:02:50 PM)
show user profile  killerbee2
k tnx I'll give it a try

EDIT: after further searching the net, found this :

cam = $Camera02 -- the camera
width = cam.frameWidth -- the width of the far end of the camera fov triangle
degToRad(atan(width / cam.targetDistance / 2) * 2) -- the formula to achieve the effect

read 962 times
2/28/2011 3:03:14 PM (last edit: 2/28/2011 3:06:24 PM)
show user profile  advance-software
Firstly atan usually returns radians so why is there a degToRad around it ?
Not sure about maxscript - C atan returns radians & it's based on that. Check docs.

Second - one of us might have our formula wrong.

that one comes up :

fov = 2* atan(2w/d) ... I think ... not sure about maxscript operator precedence.

Mine's correct. I've added some comments to the working so you can check for errors.
read 949 times
2/28/2011 3:12:52 PM (last edit: 2/28/2011 3:44:48 PM)
show user profile  killerbee2
propably the conversion is because fov in max can be expressed in either mm or degrees
the script propably uses the degrees

read 928 times
2/28/2011 3:28:16 PM (last edit: 2/28/2011 3:28:16 PM)
show user profile  advance-software
atan returns an angle so the result will be radians or degrees (usually radians then you apply a conversion if you want degrees).

The formula itself might be correct but I don't understand maxscript operator precedence.

I always put numerator & denominator terms in brackets so it's obvious what you're trying to do.

a/b/c isn't obvious.

it could be (a/b)/c = a/(bc)

or it could be a/(b/c) = (ac)/b
read 922 times
2/28/2011 3:33:27 PM (last edit: 3/1/2011 9:53:52 AM)
show user profile  killerbee2
ok, I got it working !

things to do :

1. create a targetcamera in your scene
2. select the camera and go to Animation > Parameter Editor
3. make a new attribute called framewidth
set the range to From 0 to 10000
4. now go to the curve editor and rightclick > assign controller on the FOV of your camera and assign a float script
5. paste this script :

cam= $Camera001
width= cam.framewidth


if your camera has a different name, change it accordingly.

6. animate your camera and watch the effect happening
7. if you need to get closer to the subject you can do so by adjusting the framewidth attribute.

read 915 times
2/28/2011 3:36:48 PM (last edit: 5/28/2011 12:09:37 PM)
show user profile  advance-software
Cool. Just checked. atan(1) = 45.0 in maxscript so it returns the result in degrees (unlike C which returns the result in radians).

Guess the operator precedence must work out fine though I wouldn't write code like that because it's hard to read.

As whatever you're feeding it into wants an angle in radians you need the degToRad operation.

read 909 times
2/28/2011 3:42:31 PM (last edit: 3/1/2011 9:54:49 AM)
show user profile  killerbee2
after some searching, here's an expression in case you wanna do it in aftereffects :

place this in the Zoom property of a target camera (alt+click the stopwatch)

target = thisComp.layer("target");
V1 = target.toWorld(target.anchorPoint) - toWorld([0,0,0]);
V2 = toWorldVec([0,0,1]);

and rename the layer you want to be locked on to "target"'

read 805 times
3/8/2011 3:43:59 PM (last edit: 3/8/2011 3:44:30 PM)
show user profile  Mashedpot8er
You chaps lost me with all the techie business. Just wanted to add that there's a really nice example of this effect in the film ' la haine' too :) Great film as well.

Edit: here it is :)

Cad Monkey

read 789 times
3/8/2011 8:57:01 PM (last edit: 3/8/2011 8:58:12 PM)
First page  Go to the previous page   [01]  [02]  Go to the next page  Last page
#Maxforums IRC
Open chat window