Verge3D for 3ds Max: Working with Camera — Soft8Soft
Description: Find out how to create and control 3ds Max cameras to be used with Verge3D.

# Working with Camera / 3ds Max

This page contains the information on how to setup 3ds Max's cameras to be used with Verge3D.

- Setting Up in 3ds Max
- Camera Settings
  - Targeted Camera Settings
  - First-Person Camera Settings
- Fit to Camera Edge
- Camera Control with Puzzles

#

## Setting Up in 3ds Max

Simply add one of the supported cameras to you scene:

- Physical
- Target
- Free

Camera scaling values > 100 or < 100 are not recommended to use with Verge3D. Be sure to set the scaling factor for your cameras to 100.

#

## Camera Settings

Each camera in 3ds Max is assigned with the following Verge3D settings:

Viewport Fit
  How the viewport will react to changing its dimensions (or device orientation).
  Vertical
    Fit vertical field of view. This mode is good for tall scenes. By fixing vertical field of view you will be ensured that your object will fit into the camera in both landscape (desktops/laptops) and portrait (phones) modes
  Horizontal
    Fit horizontal field of view. Contrary to Horizontal, this mode is good for wide scenes.
Allow Panning
  Enable/disable camera panning.
Rot. Speed
  Camera rotation speed factor.
Mov. Speed
  Camera movement speed factor.
Targeted Camera Limits
  Settings for targeted (aka orbit) cameras, see below.
First-Person
  Settings for first-person cameras, see below.
Disable Controls
  Disable all camera controls — mouse, touch, keyboard. Specify if you're going to move your camera with animations, Puzzles, or JavaScript.

#

### Targeted Camera Settings

Use the following settings to control parameters of the Target and targeted Physical cameras.

Persp Min Dist, Persp Max Dist

  Distance limits for perspective camera. In Verge3D realm, "zooming" for the perspective orbit camera means "moving forward/backwards", thus distance limits assigned to such a camera indirectly affect the min/max limits of zooming.

  If you need to perform zooming by changing the camera field-of-view (FOV), while keeping the camera in place, use the set camera param puzzle.

Ortho Min Zoom, Ortho Max Zoom
  Zoom limits for orthographic camera. In Verge3D realm, "zooming" for the orthographic orbit camera means "making camera volume larger/smaller". The camera itself don't move.
Min Vertical Angle, Max Vertical Angle
  Vertical (up-down) angle limits.
Min Horizon Angle, Max Horizon Angle
  Horizontal (left-right) angle limits.

Please note that in the Puzzles editor and JavaScript API the "Targeted" camera is called "Orbit".

#

### First-Person Camera Settings

The following settings allow you to setup first-person camera controls without using Puzzles or JavaScript.

Enabled
  Enable first-person camera controls mode.
Collision Material

  Collision material which will be used to control the zone the camera can move within. Basically, the zone above this material is allowed, all other places including empty is forbidden. If you don't specify this value, the camera will operate in free-flight mode.

  If you don't want the collision object to be visible to the user, just hide it in 3ds Max (use the switcher with the eye icon on it).

Gaze Level
  First-person camera "gaze" (or "head"/"eyes") level.
Story Height
  Maximum height of the story. Specify if you need multiple floors in your scene, such as two-level cottage or large shopping mall.
Enable PointerLock
  Enable the pointer lock feature to capture the mouse pointer upon app start. The user should click somewhere on the screen to lock up the cursor and move in 3D space without the need to click/drag with the mouse buttons.

First-person collisions are handled by Verge3D runtime and thus do not require activating physics engine module.

For usage example, check out the Firstperson Camera demo (source files available in the Asset Store).

#

## Fit to Camera Edge

Fit to Camera Edge is a technique to draw screen-space UI elements based on 3ds Max models. This approach to UI design is more “native” to the 3D artist than using HTML/CSS, and does not require external tools. But there is more in it: since the UI elements are genuine 3D objects, you can apply shaders, lighting, animation, morphing – you name it – making them truly interactive and seamlessly integrated into the scene.

When you parent some object to the camera, the following settings appear on the Verge3D Adv. Rendering Params panel:

Horizontal
  Horizontal canvas edge to fit object to. None — no horizontal fit, Left — fit to left edge, Right — fit to right edge, Stretch — scale object horizontally to fit on the screen.
Vertical
  Vertical canvas edge to fit object to. None — no vertical fit, Top — fit to top edge, Bottom — fit to bottom edge, Stretch — scale object vertically to fit on the screen.
Shape
  Canvas fit shape. Box — use object's bounding box, Sphere — use object's bounding sphere to fit the object on the screen, Point — ignore object boundings and use its center to fit the object on the screen.
Fit Offset
  Additional offset used to fit object on the screen. Effectively, this value extends object bounding (box or sphere) by the specified absolute value.

#

## Camera Control with Puzzles

You can use camera puzzles to control your camera in real time.

## Got Questions?

Feel free to ask on the forums!