Class: StereoEffect

StereoEffect~StereoEffect(renderer, optionsopt)

Uses dual PerspectiveCameras for Parallax Barrier effects.

Constructor

new StereoEffect(renderer, optionsopt)

Parameters:
Name Type Attributes Default Description
renderer THREE.WebGLRenderer WebGL renderer
options Options <optional>
new Options() Options instance. See options parameter of MyThree class.
Properties
Name Type Attributes Default Description
getLanguageCode function <optional>
language code of your browser Your custom getLanguageCode() function.
returns the "primary language" subtag of the language version of the browser.
Examples: "en" - English language, "ru" Russian.
See the Syntax paragraph of RFC 4646 for details.
lang Object <optional>
Object with localized language values.
dat.cookie boolean <optional>
false - do not save to cookie the StereoEffects settings
dat.cookieName string <optional>
Name of the cookie is "StereoEffect" + options.dat.cookieName.
stereoEffect boolean | Object <optional>
false - do not create a StereoEffect instance.

Or:

Properties
Name Type Attributes Default Description
spatialMultiplex number <optional>
spatialMultiplexsIndexs.Mono spatial multiplex
See DVB 3D-TV for details
	Available values

		spatialMultiplexsIndexs.Mono - no stereo effacts

		spatialMultiplexsIndexs.SbS - 'Side by side' format just put the left and right images one next to the other.
			See https://en.wikipedia.org/wiki/DVB_3D-TV#Side_by_side for dretails

		spatialMultiplexsIndexs.TaB - 'Top and bottom' format put left and right images one above the other.
			See //https://en.wikipedia.org/wiki/DVB_3D-TV#Top_and_bottom for details

	Example - options.stereoEffect.spatialMultiplex: StereoEffect.spatialMultiplexsIndexs.Mono
camera THREE.PerspectiveCamera <optional>
PerspectiveCamera. Use the camera key if you want control cameras focus.
far Float <optional>
10 Camera frustum far plane. The far key uses for correct calculation default values of Eye separation. See far parameter of the PerspectiveCamera
eyeSep Float <optional>
( new THREE.StereoCamera().eyeSep / 10 ) * options.stereoEffect.far Eye separation. See StereoCamera.eyeSep.
stereoAspect Float <optional>
1 THREE.StereoCamera.aspect. Camera frustum aspect ratio.
rememberSize boolean <optional>
true - remember default size of the canvas. Resize of the canvas to full screen for stereo mode and restore to default size if no stereo effacts.
elParent HTMLElement <optional>
parent of the canvas. Use only if you use THREE.Raycaster (working out what objects in the 3d space the mouse is over) and your canvas is not full screen.
Source:

Namespaces

getTextIntersection

Members

(static, readonly) spatialMultiplexsIndexs :number

Enumeration of available stereo modes. Available as StereoEffect.spatialMultiplexsIndexs.
Type:
  • number
Properties:
Name Type Description
Mono number No stereo effect
SbS number Side by side
TaB number Top and bottom
Source:
See:

options

See options parameter of the StereoEffect class above.
Source:

settings

See options.stereoEffect parameter of the StereoEffect class above.
Source:

Methods

createCanvasMenuItem(canvasMenuopt, paramsopt)

Adds a StereoEffect's menu item into CanvasMenu.
Parameters:
Name Type Attributes Description
canvasMenu CanvasMenu <optional>
CanvasMenu.
params Object <optional>
the following params are available.
Properties
Name Type Attributes Default Description
getLanguageCode function <optional>
language code of your browser Your custom getLanguageCode() function.
returns the "primary language" subtag of the language version of the browser.
Examples: "en" - English language, "ru" Russian.
See the Syntax paragraph of RFC 4646 for details.
Source:

getRendererSize() → {getMousePosition:function}

Convert mouse position to renderer coordinates.
Source:
Returns:

Type
getMousePosition:function

gui(guiParamsopt)

Adds StereoEffects folder into dat.GUI.
Parameters:
Name Type Attributes Default Description
guiParams Object <optional>
{} the following params are available.
Properties
Name Type Attributes Default Description
dat GUI <optional>
dat.GUI().
folder GUI <optional>
StereoEffects folder. See dat.gui for details
onChangeMode function <optional>
The event is fired if user has changed the stereo mode.
parameter is new stereo mode.
See the settings.spatialMultiplex parameter of the StereoEffect class for details.
scale number <optional>
1 scale of allowed values.
Source:
See:

render(scene, camera)

Render a scene or another type of object using a camera.
Parameters:
Name Type Description
scene THREE.Scene Scene.
camera THREE.Camera PerspectiveCamera.
Source:
See:

setEyeSeparation(eyeSep)

Sets eye separation.
Parameters:
Name Type Description
eyeSep any See options.stereoEffect.eyeSep parameter of the StereoEffect class above.
Source: