Precise camera location and focal length?

Next
 From:  Dejan (XDEXX)
8476.1 
Hello,

I have two questions:

1/ Is it possible to set camera (3D view) to precise location (4m from the origin), height 1,75m and focal length of 45mm (full frame 35mm camera)? To mimic human vision?

2/ Is it possible to save that view and come back to it quickly?

My students are trying to create so-called perspective sculpture where object looks correct only from certain position. Idea is to fabricate and display few of the best deigns at the local national park. I hope that you can help us figure out this challenge (and our first attempt at 3D design)...

With best regards from Holland,
Dejan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
8476.2 In reply to 8476.1 
My amateur response:

There is an htm file by Michael, that replaces the MoI file in its ui, to additionally show camera position and target position.

http://moi3d.com/forum/index.php?webtag=MOI&msg=6962.13

MoI usage: Options/View/3d view angles

- Brian

I was working on a script June 2016, on ViewAdjust, after prompting by Pilou, but have been too busy to finish it.
I guess there is no point in posting nonfunctional code, unless ... :-)
Most of the time was spent trying to squeeze the numbers into the (corners of the) MoI screen.

EDITED: 17 Jun by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8476.3 In reply to 8476.1 
Hi Dejan, try setting the following script on a shortcut key, under Options > Shortcut keys:

script: /* set view position and angle */ var vm = moi.vectorMath; var eye = vm.createPoint( 4, 0, 1.75 ); var lookat = vm.createPoint( 0, 0, 0 ); vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.setCameraAndTarget( eye, lookat ); var focal_length = 45; var angle = Math.atan2(12,focal_length) * 360.0 / Math.PI; vp.fieldOfViewAngle = angle;

Copy/paste the entire script above into the "command" part of the shortcut key. Then you can trigger it by pushing that key.

You may need to adjust the coordinates for the eye point, it's set to x = 4, y = 0, z = 1.75 in the script there, modify it to whatever location you need.

To set that as the default for when you initially start up MoI, save out a .3dm file with the view set up how you want it and then set that .3dm file as the startup template under Options > General > Template file. Then MoI should get the initial views from that file when you start up MoI or do a File > New.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
8476.4 In reply to 8476.3 
With unit system set to meters under Options/General,
for a 2 meter sphere, applying Michaels script results in the sphere occupying most of the 3d view, a good result for people sized objects.

What is the significance of 12 in the atan2 calculation? (What is 12, and why 12?)
(Using a tape measure, my 2 meter sphere measures 10.5 inches on my screen.)

- Brian

https://en.wikipedia.org/wiki/Angle_of_view

EDITED: 18 Jun by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Dejan (XDEXX)
8476.5 
Brian & Michael,

thanks for all the info. We'll try it out tomorrow and let you know.

Cheers!
-Dejan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8476.6 In reply to 8476.4 
Hi Brian, the 12 has to do with the film size of a 35mm camera, it has a film size of 36x24mm. So that combined with the focal length determines the field of view angle. You use 12 because in MoI the field of view controls the innermost square of the view (http://moi3d.com/forum/index.php?webtag=MOI&msg=3644.34 http://moi3d.com/forum/index.php?webtag=MOI&msg=3644.5) so that corresponds to the 24mm height, then to form a right triangle you take half that:




- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
8476.7 In reply to 8476.6 
Thank you very much Michael.
- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  TOM (SIRTOM)
8476.8 
Great helper ! I would like to ask 3 questions here :

I have positioned the camera manually in a scene for which I want to make use of the new script now.

- How / Where can I get the exact coordinates of the camera viewpoint I placed manually ?

- Is it possible to rotate the camera around a specific coordinate (fixed / defined by a point object) ?

- If the viewpoint is infinite (horizon) just type in a very high value for Y ?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8476.9 In reply to 8476.8 
Hi Tom,


> - How / Where can I get the exact coordinates of the camera viewpoint I placed manually ?

Use the extended ViewAngleDialog.htm file that Brian linked to above, it's here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=6962.13

The updated version adds camera xyz location controls to the 3D view angles dialog box, which you can access under Options > View > "3D view angles" button.


> - Is it possible to rotate the camera around a specific coordinate (fixed / defined by a point object) ?

With the regular built in view controls MoI will only rotate the camera around the current view target point. But you could rotate it around whatever point you like using your own math calculations, see here for an example: https://academo.org/demos/rotation-about-point/


> - If the viewpoint is infinite (horizon) just type in a very high value for Y ?

Sorry I don't understand this part - you probably don't want to put in a very high value for the camera's y coordinate since that will place your eye point very very far away from your model and with perspective foreshortening your model will be a tiny speck on the screen.

Can you explain in some more detail about what you're trying to do with the horizon?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Message 8476.10 deleted 19 Jun by BEMFARMER

Previous
Next
 From:  TOM (SIRTOM)
8476.11 In reply to 8476.9 
Hi David,

> If the viewpoint is infinite (horizon) just type in a very high value for Y ?
Can you explain in some more detail about what you're trying to do with the horizon?<


I want to import a scene from Cinema and coordinate the cameras. In Cinema you have a horizon
line and it is the horizon where the camera is targeted at. Is there a horizon line in Moi for the
respective focal length ?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
8476.12 In reply to 8476.11 
Hi Tom,

> I want to import a scene from Cinema and coordinate the cameras. In Cinema you have a horizon
> line and it is the horizon where the camera is targeted at. Is there a horizon line in Moi for the
> respective focal length ?

Can you show me a screenshot of what the Cinema4D camera properties look like?

I'm not really familiar with setting a camera direction by a horizon line value. In MoI the target point is what is used for controlling where the camera is looking at, it's the "look_at" point in the script above.

There does exist a horizon line for the ground plane in a 3D view in MoI but it's not something that you specify directly.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All