Live3D stuff

In[5]:=

proj[v_, u_] := (v . u)/(v . v) v ;

In[6]:=

orth[v_, u_] := u - proj[v, u] ;

In[7]:=

planeProj[{n_, q_}, p_] := q + orth[n, p - q] ;

In[8]:=

planeRefl[{n_, q_}, p_] := planeProj[{n, q}, p] - proj[n, p - q]

In[9]:=

planeRefl[{n, q}, p]

Out[9]=

p - (2 n n . (p - q))/n . n

R

In[11]:=

Show[Graphics[{Point/@rpts}], PlotRange {{-1, 1}, {-1, 1}}, AspectRatioAutomatic]

[Graphics:HTMLFiles/index_13.gif]

Out[11]=

⁃Graphics⁃

In[12]:=

r3d = Append[#, 0] &/@rpts ;

In[13]:=

Show[Graphics3D[Point/@r3d]]

[Graphics:HTMLFiles/index_17.gif]

Out[13]=

⁃Graphics3D⁃

In[14]:=

rsine = Append[#, .2Sin[6#[[1]]] Cos[6#[[2]]]] &/@rpts ;

In[15]:=

Show[Graphics3D[Point/@rsine]]

[Graphics:HTMLFiles/index_21.gif]

Out[15]=

⁃Graphics3D⁃

In[16]:=

Show[Graphics3D[Line[rsine]]]

[Graphics:HTMLFiles/index_24.gif]

Out[16]=

⁃Graphics3D⁃

In[17]:=

{q1, q2, q3} = {{-1, -1, 2}, {0, 1, 3}, {1, 0, 1}} ;

In[18]:=

triNormal = Cross[q2 - q1, q3 - q1]

Out[18]=

{-3, 3, -3}

In[19]:=

Show[Graphics3D[{Line[rsine], Polygon[{q1, q2, q3}]}], PlotRangeAll]

[Graphics:HTMLFiles/index_30.gif]

Out[19]=

⁃Graphics3D⁃

In[20]:=

Show[Graphics3D[{Line[r3d], Polygon[{q1, q2, q3}], Line[planeRefl[{triNormal, q1}, #] &/@r3d]}], PlotRangeAll]

[Graphics:HTMLFiles/index_33.gif]

Out[20]=

⁃Graphics3D⁃

In[36]:=

RowBox[{Show, [, RowBox[{Graphics3D[{Line[r3d], Polygon[{q1, q2, q3}], Hue[.66], Line[planeRef ... l, ,, RowBox[{ViewPoint, ->, RowBox[{{, RowBox[{2.493, ,,  , 2.267, ,,  , 0.312}], }}]}]}], ]}]

[Graphics:HTMLFiles/index_36.gif]

Out[36]=

⁃Graphics3D⁃

In[22]:=

WriteLiveForm["rrr.m", %]


Created by Mathematica  (October 15, 2003)