-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcamera.html
More file actions
99 lines (81 loc) · 4.33 KB
/
Copy pathcamera.html
File metadata and controls
99 lines (81 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Merriweather:300">
<link rel="icon" type="image/png" href="https://android.processing.org/favicon.png">
<link rel="stylesheet" href="../../css/main.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Processing for Android</title>
<!-- Fathom - beautiful, simple website analytics -->
<script src="https://cdn.usefathom.com/script.js" data-site="KCUSYTHO" defer></script>
<!-- / Fathom -->
</head>
<body>
<nav class="topnav">
<ul class="left">
<li><a href="https://processing.org/">Processing</a></li>
<li><a href="https://p5js.org/">p5.js</a></li>
<li><a href="https://py.processing.org/">Processing.py</a></li>
<li><a href="https://pi.processing.org/">Processing for Pi</a></li>
</ul>
<ul class="foundation">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
</nav>
<header>
<h1 class="title">Processing for Android</h1>
</header>
<div class="group">
<nav class="site">
<img class="logo" src="../../imgs/logo.png" alt="Processing for Android logo">
<ul class="leftnav">
<li><a href="../../index.html">Home</a></li>
<li><a href="../../install.html">Install</a></li>
<li><a id="selected" href="../../reference/index.html">Reference</a>
<li><a href="../../tutorials/index.html">Tutorials</a></li>
<li><a href="../../books/index.html">Books</a></li>
<li><a href="../../gallery/index.html">Gallery</a></li>
<li><a href="https://discourse.processing.org/c/processing-android" target="_black">Forum</a></li>
<li><a href="https://github.com/processing/processing-android" target="_black">GitHub</a></li>
</ul>
</nav>
<section class="container main-text">
<div class="lang">
<a id="selected" href="calculate.html">EN</a>
<a href="../../es/reference/vr/camera.html">ES</a>
</div>
<hr style="clear:both;">
<h2>VRCamera</h2>
<p>The VRCamera object provides some utility functions to facilitate setting the view in VR.</p>
<ul>
<li>sticky()<br><p>It sets the coordinates to the eye system, so it is easier to draw elements that are static with respect to the head movement.</p></li>
<li>noSticky()<br><p>It returns the coordinats to the default world system, removing any transformartions that might have been applied in eye space.</p></li>
<li>setPosition(float x, float y, float z)<br><p>Sets the camera position to the point (x, y, z).</p></li>
<li>setNear(float near)<br><p>Sets the Z distance to the near plane.</p></li>
<li>setFar(float far)<br><p>Sets the Z distance to the far plane.</p></li>
</ul>
<pre><code>
<span style="color: #33997E;">import</span> processing.vr.*;
VRCamera cam;
<span style="color: #33997E;">void</span> <span style="color: #006699;"><b>setup</b></span>() {
<span style="color: #006699;">fullScreen</span>(VR);
cameraUp();
}
<span style="color: #33997E;">void</span> <span style="color: #006699;"><b>draw</b></span>() {
<span style="color: #006699;">background</span>(200, 0, 150);
cam.setPosition(0, 0, 400);
<span style="color: #666666;">//...</span>
cam.sticky();
<span style="color: #006699;">translate</span>(0, 0, 200);
circle(0, 0, 50);
cam.noSticky();
}
</code></pre>
</section>
</div>
<footer class="footinfo">
<small>© The Processing Foundation. Processing for Android is a <a href=../../team.html>collaborative project</a>.</small>
</footer>
</body>
</html>