sets camera viewup vector
181265
def set_viewup(self, vector):
        
        if isinstance(vector, np.ndarray):
            if vector.ndim != 1:
                vector = vector.ravel()
        self.camera.SetViewUp(vector)
        self._render()
1194659
def set_default_pos(self, defaultPos):
        """"""
        self.coords = defaultPos
        self.velocity = r.Vector2()
        self.desired_position = defaultPos
        r.Ragnarok.get_world().Camera.pan = self.coords
        r.Ragnarok.get_world().Camera.desired_pan = self.coords
1246051
function viewPoint2SvgPoint(props, clientX, clientY) {
  const svgPoint = props.svgPoint;
  svgPoint.x = clientX;
  svgPoint.y = clientY;
  return svgPoint.matrixTransform(props.svgCtmElement.getScreenCTM().inverse());
}
1306534
def _set_view(self):
        """"""
        if self.logarithmic:
            if self._dual:
                view_class = XYLogView
            else:
                view_class = LogView
        else:
            view_class = ReverseView if self.inverse_y_axis else View

        self.view = view_class(
            self.width - self.margin_box.x, self.height - self.margin_box.y,
            self._box
        )
890486
def look_at(self, x, y, z):
        """"""
        for camera in self.cameras:
            camera.look_at(x, y, z)
667473
private void mapMouseToPlane(Simple1DOFCamera camera, Point point2d, double[] vec) {
    // Far plane
    camera.unproject(point2d.x, point2d.y, -100., far);
    // Near plane
    camera.unproject(point2d.x, point2d.y, 1., near);
    // Delta vector: far -= near.
    VMath.minusEquals(far, near);
    // Intersection with z=0 plane:
    // far.z - a * near.z = 0 -> a = far.z / near.z
    if (near[2] < 0 || near[2] > 0) {
      double a = far[2] / near[2];
      vec[0] = far[0] - a * near[0];
      vec[1] = far[1] - a * near[1];
      vec[2] = 0;
    }
  }
140394
def __vCmdSetCamAperture(self, args):
        ''''''
        if len(args) == 1:
            for cam in self.camera_list:
                cam.boSetAperture(int(args[0]))
        elif len(args) == 2:
            cam = self.camera_list[int(args[1])]
            cam.boSetAperture(int(args[0]))
        else:
            print ("Usage: setCamAperture APERTURE [CAMNUMBER], APERTURE is value x10")
1297976
private void SetNewViewpoint(String url) {
        Viewpoint vp = null;
        // get the name without the '#' sign
        String vpURL = url.substring(1, url.length());
        for (Viewpoint viewpoint : viewpoints) {
            if ( viewpoint.getName().equalsIgnoreCase(vpURL) ) {
                vp = viewpoint;
            }
        }
        if ( vp != null ) {
            // found the Viewpoint matching the url
            GVRCameraRig mainCameraRig = gvrContext.getMainScene().getMainCameraRig();
            float[] cameraPosition = vp.getPosition();
            mainCameraRig.getTransform().setPosition( cameraPosition[0], cameraPosition[1], cameraPosition[2] );

            // Set the Gaze controller position which is where the pick ray
            // begins in the direction of camera.lookt()
            GVRCursorController gazeController = null;
            GVRInputManager inputManager = gvrContext.getInputManager();

            List<GVRCursorController> controllerList = inputManager.getCursorControllers();

            for(GVRCursorController controller: controllerList){
                if(controller.getControllerType() == GVRControllerType.GAZE);
                {
                    gazeController = controller;
                    break;
                }
            }
            if ( gazeController != null) {
                gazeController.setOrigin(cameraPosition[0], cameraPosition[1], cameraPosition[2]);
            }
        }
        else {
            Log.e(TAG, "Viewpoint named " + vpURL + " not found (defined).");
        }
    }
787557
protected void reopenCameraAtResolution(int cameraWidth, int cameraHeight) {

		if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
			throw new RuntimeException("Attempted to reopenCameraAtResolution main looper thread!");
		}

		boolean releaseLock = true;
		open.mLock.lock();
		try {
			if (verbose)
				Log.i(TAG, "Reopening camera is null == " + (open.mCameraDevice == null)+" state="+open.state+
				" activity="+getClass().getSimpleName());

			if( open.state != CameraState.OPEN )
				throw new RuntimeException("BUG! Attempted to re-open camera when not open");

			if (null == open. mCameraDevice) {
				throw new RuntimeException("Can't re-open a closed camera");
			}
			closePreviewSession();
			open.mCameraSize = null;
			firstFrame = true;

			CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
			if (manager == null)
				throw new RuntimeException("Null camera manager");

			try {
				open.mPreviewReader = ImageReader.newInstance(
						cameraWidth, cameraHeight,
						ImageFormat.YUV_420_888, 2);
				// Do the processing inside the the handler thread instead of the looper thread to avoid
				// grinding the UI to a halt
				open.mPreviewReader.setOnImageAvailableListener(onAvailableListener, mBackgroundHandler);
				configureTransform(viewWidth, viewHeight);
				manager.openCamera(open.cameraId, mStateCallback, null);
				releaseLock = false;
			} catch (IllegalArgumentException e) {
				Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
				finish();
			} catch (CameraAccessException e) {
				e.printStackTrace();
			}
		} finally {
			if(releaseLock)
				open.mLock.unlock();
		}
	}
89254
void setPerspShadowMatrix(Matrix4f modelMtx, GVRLight light)
    {
        GVRPerspectiveCamera camera = (GVRPerspectiveCamera) getCamera();

        if (camera == null)
        {
            return;
        }
        float angle = light.getFloat("outer_cone_angle");
        float near = camera.getNearClippingDistance();
        float far = camera.getFarClippingDistance();

        angle = (float) Math.acos(angle) * 2.0f;
        modelMtx.invert();
        modelMtx.get(mTempMtx);
        camera.setViewMatrix(mTempMtx);
        camera.setFovY((float) Math.toDegrees(angle));
        mShadowMatrix.setPerspective(angle, 1.0f, near, far);
        mShadowMatrix.mul(modelMtx);
        sBiasMatrix.mul(mShadowMatrix, mShadowMatrix);
        mShadowMatrix.getColumn(0, mTemp);
        light.setVec4("sm0", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(1, mTemp);
        light.setVec4("sm1", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(2, mTemp);
        light.setVec4("sm2", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(3, mTemp);
        light.setVec4("sm3", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
    }
1353073
def setCamera(self, camera_name, bit_depth=16):
        '''
        
        '''
        self.coeffs['name'] = camera_name
        self.coeffs['depth'] = bit_depth
668690
function View(props) {
	props = props || {};
	this.addCanvasContainerToDOMBody = this.addCanvasContainerToDOMBody.bind(this);
	this.addCanvasToContainer = this.addCanvasToContainer.bind(this);

	this.adaptiveResolution = props.adaptiveResolution;
	this.adaptiveResolutionManager = new AdaptiveResolutionManager(props.adaptiveResolutionSettings);

	this.fitAxis = props.fitAxis || 'y';

	this.skipRender = Boolean(props.skipRender);
	this.scene = props.scene || new THREE.Scene();
	props.rendererSettings = props.rendererSettings || {};
	if(props.camera) {
		this.camera = props.camera;
	} else {
		this.camera = new THREE.PerspectiveCamera();
		this.scene.add(this.camera);
		this.camera.position.z = 8.50;
		this.camera.position.y = 8.0;
		this.camera.lookAt(this.scene.position);
	}
	if(this.camera instanceof THREE.PerspectiveCamera) {
		this.setCamera = this.setCameraPerspective;
	} else if (this.camera.isOrthographicCamera) {
		this.setCamera = this.setCameraOthrographic;
	}
	this.autoStartRender = props.autoStartRender !== (undefined ? props.autoStartRender : true);
	this.canvasContainerID = props.canvasContainerID || "WebGLCanvasContainer";

	this.domMode = props.domMode || (props.canvasContainer ? DOMMode.CONTAINER : DOMMode.FULLSCREEN);
	this.canvasContainer = props.canvasContainer || this.createCanvasContainer(this.canvasContainerID);
	this.canvasID = props.canvasID || "WebGLCanvas";
	this.domMode = props.domMode || (this.canvasContainer ? DOMMode.CONTAINER : DOMMode.FULLSCREEN);
	this.domSize = {x:0, y:0};
	
	//use provided canvas or make your own
	this.canvas = document.getElementById(this.canvasID) || this.createCanvas();
	this.rendererSettings = defaults(props.rendererSettings, {
		canvas: this.canvas,
		antialias: true,
		preserveDrawingBuffer: false
	});


	if( props.renderer !== undefined) {
		this.renderer = props.renderer;
	} else {
		this.renderer = new THREE.WebGLRenderer(this.rendererSettings);
	}
	if(this.rendererSettings.autoClear === false) {
		this.renderer.autoClear = false;
		this.renderer.autoClearColor = false;
	}

	this.renderManager = new RenderManager(this, props.useRafPolyfill);
	if(this.autoStartRender) this.renderManager.start();

	this.adaptiveResolutionManager.onChange.add(this.onAdaptiveResolutionManagerChangeResolution.bind(this));

	this.renderer.setPixelRatio(window.devicePixelRatio);
	this.dpr = this.renderer.getPixelRatio();

	this.setupResizing();

	if(props.stats) {
		this.stats = new RenderStats(this.renderer);
		this.renderManager.onEnterFrame.add(this.stats.onEnterFrame);
		this.renderManager.onExitFrame.add(this.stats.onExitFrame);
	}

}
87057
function (x, y, width, height, dpr) {
        var viewport;
        if (typeof x === 'object') {
            viewport = x;
        }
        else {
            viewport = {
                x: x, y: y,
                width: width, height: height,
                devicePixelRatio: dpr || 1
            };
        }
        this._frameBuffer.viewport = viewport;
    }
1143973
function CameraUI() {

    // Root element for preview 
    var container = document.createElement('div');
    container.style.cssText = "left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index:9999;" +
                                   "padding: 40px; background-color: rgba(0,0,0,0.75);" + 
                                   "text-align:center; visibility: hidden";

    // Set up root element contetnts
    container.innerHTML =
        '<div id="captureHint" style="height:100%; position:relative; display:inline-flex; align-content:flex-start;">' +
        '<h2 style="position: absolute; width: 100%; background-color: rgba(255,255,255,0.25); margin: 0">' +
            'Click on preview to capture image. Click outside of preview to cancel.</h1>' + 
        '<video id="capturePreview" style="height: 100%"></video>' +
        '</div>';

    // Add container element to DOM but do not display it since visibility == hidden
    document.body.appendChild(container);

    // Create fullscreen preview
    var preview = document.getElementById('capturePreview');
    preview.autoplay = true;
    // We'll show preview only when video element content
    // is fully loaded to avoid glitches
    preview.onplay = function () {
        container.style.visibility = 'visible';
    };

    this.container = container;
    this.preview = preview;
}
57977
def _set_view(self):
        """"""
        if self.logarithmic:
            view_class = HorizontalLogView
        else:
            view_class = HorizontalView

        self.view = view_class(
            self.width - self.margin_box.x, self.height - self.margin_box.y,
            self._box
        )
942015
def cmd_cameraview(self, args):
        ''''''
        state = self
        if args and args[0] == 'set':
            if len(args) < 3:
                state.view_settings.show_all()
            else:
                state.view_settings.set(args[1], args[2])
                state.update_col()
        else:
            print('usage: cameraview set')
143145
public void set( CameraUniversalOmni original ) {
		super.set(original);

		this.mirrorOffset = original.mirrorOffset;

		if( radial.length != original.radial.length )
			radial = new double[ original.radial.length ];
		System.arraycopy(original.radial,0,radial,0,radial.length);

		this.t1 = original.t1;
		this.t2 = original.t2;
	}