Warning: Table './planetar_drpl3/sessions' is marked as crashed and should be repaired query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = 'e289370fbd3c5d19fbf33c2071505a5c' in /home/planetar/public_html/blendtips/includes/database.mysql.inc on line 172

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/planetar/public_html/blendtips/includes/database.mysql.inc:172) in /home/planetar/public_html/blendtips/includes/bootstrap.inc on line 811

Warning: Cannot modify header information - headers already sent by (output started at /home/planetar/public_html/blendtips/includes/database.mysql.inc:172) in /home/planetar/public_html/blendtips/includes/bootstrap.inc on line 488

Warning: Cannot modify header information - headers already sent by (output started at /home/planetar/public_html/blendtips/includes/database.mysql.inc:172) in /home/planetar/public_html/blendtips/includes/bootstrap.inc on line 489

Warning: Cannot modify header information - headers already sent by (output started at /home/planetar/public_html/blendtips/includes/database.mysql.inc:172) in /home/planetar/public_html/blendtips/includes/bootstrap.inc on line 490

Warning: Cannot modify header information - headers already sent by (output started at /home/planetar/public_html/blendtips/includes/database.mysql.inc:172) in /home/planetar/public_html/blendtips/includes/bootstrap.inc on line 491
Tutorial: Rotating a 3D object with sliders | Drupal

Tutorial: Rotating a 3D object with sliders

warning: Cannot modify header information - headers already sent by (output started at /home/planetar/public_html/blendtips/includes/database.mysql.inc:172) in /home/planetar/public_html/blendtips/includes/common.inc on line 141.


This tutorial is included in our book, Blend Bible, but corrections that we made to it at the last minute did not make it into the final version of the book, so we are including the corrected version here. To see the XBAP, click here. To download the project, click here.
1) Choose Project->Add Existing Item to add a 3D model with a .obj extension to your project, and add the .mtl file as well. (To create the model in the first place, we used Blender and chose Add -> Mesh -> Monkey.)
2) Add the model into the artboard by right-clicking on the .obj file and choosing Insert.
3) Open the Asset Library in the Toolbox, click Slider, draw three sliders in the artboard, and name them, Slider1, Slider2 and Slider3. Select them individually and change their Maximum value to 360 in the Common Properties palette.
4) Select the 3D object, so that its transformation handles appear. (Open the expander beside the Viewport3D in the Objects list and keep opening expanders until you select the grouped object.)
5) Click the Rotation tab in the Transform palette, and change the value in the Y input box to any number other than 0. We changed it to 3. (The reason you do this is to generate some code in the XAML which you will change below.)
6) Click the XAML tab to view the XAML code. Find the following code or similar code:
<RotateTransform3D d:EulerAngles="0,3,0">
   <RotateTransform3D.Rotation>
      <AxisAngleRotation3D Angle="3" Axis="0,1,0"/>
   </RotateTransform3D.Rotation>
</RotateTransform3D>
7) Change the code to the following:
<RotateTransform3D d:EulerAngles="0,3,0">
   <RotateTransform3D.Rotation>
      <AxisAngleRotation3D Angle="{Binding Path=Value,
ElementName=Slider1}" Axis="0,1,0"/>
   </RotateTransform3D.Rotation>
</RotateTransform3D>
8) Test your slider by choosing Project -> Test Project or pressing F5 to be sure one slider works.
9) View the XAML again and add a few more lines of code, similar to what's above, but to reflect the new axis of rotation and different slider to databind to. See the expanded code.
"