1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3//EN"> 2<HTML><HEAD> 3 <TITLE>User's Reference - AutoCamera</TITLE> 4 <META HTTP-EQUIV="keywords" CONTENT="GRAPHICS VISUALIZATION VISUAL PROGRAM DATA 5MINING"> 6 <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> 7</HEAD><BODY BGCOLOR="#FFFFFF" link="#00004b" vlink="#4b004b"> 8 <TABLE width=510 border=0 cellpadding=0 cellspacing=0> 9 <TR> 10 <TD><IMG src="../images/spacer.gif" width=80 height=1></TD> 11 <TD><IMG src="../images/spacer.gif" width=49 height=1></TD> 12 <TD><IMG src="../images/spacer.gif" width=24 height=1></TD> 13 <TD><IMG src="../images/spacer.gif" width=100 height=1></TD> 14 <TD><IMG src="../images/spacer.gif" width=3 height=1></TD> 15 <TD><IMG src="../images/spacer.gif" width=127 height=1></TD> 16 <TD><IMG src="../images/spacer.gif" width=6 height=1></TD> 17 <TD><IMG src="../images/spacer.gif" width=50 height=1></TD> 18 <TD><IMG src="../images/spacer.gif" width=71 height=1></TD> 19 </TR> 20 <TR> 21 <TD colspan=9><IMG src="../images/flcgh_01.gif" width=510 height=24 alt="OpenDX - Documentation"></TD> 22 </TR> 23 <TR> 24 <TD colspan=2><A href="../allguide.htm"><IMG src="../images/flcgh_02.gif" width=129 height=25 border="0" alt="Full Contents"></A></TD> 25 <TD colspan=3><A href="../qikguide.htm"><IMG src="../images/flcgh_03.gif" width=127 height=25 border="0" alt="QuickStart Guide"></A></TD> 26 <TD><A href="../usrguide.htm"><IMG src="../images/flcgh_04.gif" width=127 height=25 border="0" alt="User's Guide"></A></TD> 27 <TD colspan=3><B><A href="../refguide.htm"><IMG src="../images/flcgh_05d.gif" width=127 height=25 border="0" alt="User's Reference"></A></B></TD> 28 </TR> 29 <TR> 30 <TD><A href="refgu014.htm"><IMG src="../images/flcgh_06.gif" width=80 height=17 border="0" alt="Previous Page"></A></TD> 31 <TD colspan=2><A href="refgu016.htm"><IMG src="../images/flcgh_07.gif" width=73 height=17 border="0" alt="Next Page"></A></TD> 32 <TD><A href="../refguide.htm"><IMG src="../images/flcgh_08.gif" width=100 height=17 border="0" alt="Table of Contents"></A></TD> 33 <TD colspan=3><A href="refgu009.htm"><IMG src="../images/flcgh_09.gif" width=136 height=17 border="0" alt="Partial Table of Contents"></A></TD> 34 <TD><A href="refgu175.htm"><IMG src="../images/flcgh_10.gif" width=50 height=17 border="0" alt="Index"></A></TD> 35 <TD><A href="../srchindx.htm"><IMG src="../images/flcgh_11.gif" width=71 height=17 border="0" alt="Search"></A></TD> 36 </TR> 37 </TABLE> 38 <H3><A NAME="HDRAUTOCAM" ></A>AutoCamera</H3> 39 <A NAME="IDX370"></A><A NAME="IDX371"></A> 40<P><STRONG>Category</STRONG> 41<P> 42<A HREF="refgu008.htm#HDRCATREN">Rendering</A> 43<A NAME="IDX372"></A> 44<A NAME="IDX373"></A> 45<P><STRONG>Function</STRONG> 46<P> 47Constructs a camera for viewing an object. 48<P><STRONG>Syntax</STRONG> 49<PRE><STRONG> 50camera</STRONG> = AutoCamera(<STRONG>object, direction, width, resolution, 51 aspect, up, perspective, angle, background</STRONG>); 52</PRE> 53<P><STRONG>Inputs</STRONG> 54<BR> 55<TABLE BORDER> 56<TR> 57<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Name 58</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Type 59</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Default 60</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">Description 61</TH></TR><TR> 62<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>object</STRONG></TT> 63</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">object or vector 64</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none 65</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">object to be looked at 66</TD></TR><TR> 67<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>direction</STRONG></TT> 68</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">vector, string, or object 69</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">"front" 70</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">position of camera 71</TD></TR><TR> 72<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>width</STRONG></TT> 73</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">scalar or object 74</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">input dependent 75</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">width of field of view 76</TD></TR><TR> 77<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>resolution</STRONG></TT> 78</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">integer 79</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">640 80</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">pixels across image 81</TD></TR><TR> 82<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>aspect</STRONG></TT> 83</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">scalar 84</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">0.75 85</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">height/width 86</TD></TR><TR> 87<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>up</STRONG></TT> 88</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">vector 89</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">[0 1 0] 90</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">up direction 91</TD></TR><TR> 92<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>perspective</STRONG></TT> 93</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">flag 94</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">0 95</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">0: orthographic projection 96<BR> 971: perspective projection 98</TD></TR><TR> 99 100<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>angle</STRONG></TT> 101</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">scalar 102</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">30.0 103</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">view angle (in degrees) 104(for perspective projection) 105</TD></TR><TR> 106<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>background</STRONG></TT> 107</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">vector or string 108</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">"black" 109</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">image background color 110</TD></TR></TABLE> 111<P><STRONG>Outputs</STRONG> 112<BR> 113<TABLE BORDER> 114<TR> 115<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">Name 116</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">Type 117</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">Description 118</TH></TR><TR> 119<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%"><TT><STRONG>camera</STRONG></TT> 120</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">camera 121</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">resulting camera 122</TD></TR></TABLE> 123<P><STRONG>Functional Details</STRONG> 124<P> 125This module differs from Camera in specifying a <I>direction</I> 126from which to view a specified object. 127(Camera specifies a "look-from" <I>point</I>.) 128 129It will automatically create an appropriate Camera for a given object for 130use with Display or Render. 131 132<TABLE CELLPADDING="3"> 133<TR VALIGN="TOP"><TD><P><B><TT><STRONG>object</STRONG></TT> 134</B></TD><TD><P>is the object for which a camera is to be created. 135You can specify this parameter as a 3-dimensional position 136in space. 137In that case, <TT><STRONG>width</STRONG></TT> must also be explicitly 138specified (see below) as a numeric value, since the module 139has no means of estimating object size. 140</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>direction</STRONG></TT> 141</B></TD><TD><P>specifies the direction from the camera eye to the center of the 142object and can be any of the following strings: 143"front," "back," "left," "right," "top," 144"bottom," and their corresponding "off" values 145("off-front," "off-back," etc., which are all 146slightly offset from the direct positions). 147Hyphens and spaces are not required for the offset (i.e., 148"offleft" and "off left" are both valid, and 149Data Explorer ignores capitalization. 150<P> 151The direction 152"front" means from the positive <I>z</I> direction; 153"back" means from the negative <I>z</I> direction; 154"left" means from the negative <I>x</I> direction, 155"top" means from the positive <I>y</I> direction, 156and so on. 157<P><B>Note: </B>This parameter controls only the direction of viewing; it does 158not 159allow you inside the object. 160For interior views, use the ClipPlane or ClipBox module, make the 161object translucent, or use the Camera module in perspective 162mode. 163<P> 164This parameter can also be specified as a vector to be added to the 165look-to point. 166You can use the Direction module for constructing look-from directions. 167But note that only the direction of the parameter is important; 168its magnitude does not affect the size of the object in 169the image. 170</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>width</STRONG></TT> 171</B></TD><TD><P>specifies the width of the image in the units of 172<TT><STRONG>object</STRONG></TT>. 173</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>resolution</STRONG></TT> 174</B></TD><TD><P>specifies the width of the image in pixels. 175</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>aspect</STRONG></TT> 176</B></TD><TD><P>specifies the height-to-width ratio of the image. 177</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>up</STRONG></TT> 178</B></TD><TD><P>specifies a vector that will be aligned with the vertical axis 179of the image. 180The default is [0 1 0]. 181</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>perspective</STRONG></TT> 182</B></TD><TD><P>specifies the method of projection used in rendering 183<TT><STRONG>object</STRONG></TT>. 184The choices are perspective (0) and orthographic (1). 185<TABLE CELLPADDING="3"> 186<TR VALIGN="TOP"><TD><P>Perspective projection 187<A NAME="IDX374"></A> 188</TD><TD><P>This method produces a realistic rendering of objects, but does not 189preserve the exact shape and measurements of the object (e.g., 190parallel lines usually do not project as being parallel). 191The camera is positioned at the vertex of the viewing angle (see 192<TT><STRONG>angle</STRONG></TT> below). 193The base of this angle is determined by the <TT><STRONG>width</STRONG></TT> 194parameter. 195Thus the actual camera position is determined by 196<TT><STRONG>width</STRONG></TT> and 197<TT><STRONG>angle</STRONG></TT> along the 198<TT><STRONG>direction</STRONG></TT> 199vector. 200</TD></TR><TR VALIGN="TOP"><TD><P>Orthographic projection 201<A NAME="IDX375"></A> 202</TD><TD><P>This method produces a somewhat artificial view of an object 203(the distance between the front and back of an object 204appears small compared to the distance between 205the object and the camera), but it preserves 206exact scale measurements and parallel lines. 207<P> 208The <TT><STRONG>angle</STRONG></TT> parameter has no effect on orthographic 209projection. 210The size of the object can be changed only by <TT><STRONG>width</STRONG></TT> 211(the default is a field of view slightly greater than the width of 212the object). 213</TD></TR></TABLE> 214For more information on these projection methods, consult a text on 215computer graphics. 216</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>angle</STRONG></TT> 217</B></TD><TD><P>specifies the viewing angle in degrees for perspective 218projection. 219</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>background</STRONG></TT> 220</B></TD><TD><P>specifies the color of the image background as either an RGB 221color or a color-name string. 222The string can be any of the defined color-name strings (see 223<A HREF="refgu033.htm#HDRCOLOR">Color</A>). 224</TD></TR></TABLE> 225<P><STRONG>Example Visual Programs</STRONG> 226<PRE> 227MovingCamera.net 228PlotLine.net 229PlotTwoLines.net 230UsingCompute.net 231UsingMorph.net 232</PRE> 233<P><STRONG>See Also</STRONG> 234<P> 235 <A HREF="refgu021.htm#HDRCAMERA">Camera</A>, 236 <A HREF="refgu033.htm#HDRCOLOR">Color</A>, 237 <A HREF="refgu047.htm#HDRDIRECT">Direction</A>, 238 <A HREF="refgu118.htm#HDRRENDER">Render</A>, 239 240 <A HREF="refgu048.htm#HDRDISPLAY">Display</A> 241 <P> 242 <HR> 243 <DIV align="center"> 244 <P><A href="../allguide.htm"><IMG src="../images/foot-fc.gif" width="94" height="18" border="0" alt="Full Contents"></A> <A href="../qikguide.htm"><IMG src="../images/foot-qs.gif" width="94" height="18" border="0" alt="QuickStart Guide"></A> <A href="../usrguide.htm"><IMG src="../images/foot-ug.gif" width="94" height="18" border="0" alt="User's Guide"></A> <A href="../refguide.htm"><IMG src="../images/foot-ur.gif" width="94" height="18" border="0" alt="User's Reference"></A></P> 245 </DIV> 246 <DIV align="center"> 247 <P><FONT size="-1">[ <A href="http://www.research.ibm.com/dx">OpenDX Home at IBM</A> | <A href="http://www.opendx.org/">OpenDX.org</A> ] </FONT></P> 248 <P></P> 249 </DIV> 250 <P></P> 251 </BODY></HTML> 252