EyeMaterialRotate.bv.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ----------------------------------------------------------------------------------------------------
  2. --
  3. -- Copyright (c) Contributors to the Open 3D Engine Project.
  4. -- For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. --
  6. -- SPDX-License-Identifier: Apache-2.0 OR MIT
  7. --
  8. --
  9. --
  10. ----------------------------------------------------------------------------------------------------
  11. --[[
  12. This is not a formal automation test. Instead, it is a helper/utility
  13. script that can be used to automatically change the Heading angle of the
  14. ArcBall camera, and being able to appreciate the Eye mesh being
  15. rendered with the Eye material from different angles.
  16. In particular, it was used to capture videos of the original Eye shader vs
  17. the updated version.
  18. ]]
  19. -- Animates the Heading angle of the ArcBall camera starting from @startHeadingDegrees
  20. -- until it reaches @stopHeadingDegrees in @numSteps. At each step (delta angle) it waits
  21. -- @waitTimePerStepSeconds seconds before changing to the next angle.
  22. function MyAnimateCamera(startHeadingDegrees, stopHeadingDegrees, numSteps, waitTimePerStepSeconds)
  23. local headingDegrees = startHeadingDegrees
  24. local deltaDegrees = (stopHeadingDegrees - startHeadingDegrees) / numSteps
  25. local stepCount = numSteps+1
  26. for step=1, stepCount do
  27. ArcBallCameraController_SetHeading(DegToRad(headingDegrees));
  28. IdleSeconds(waitTimePerStepSeconds);
  29. headingDegrees = headingDegrees + deltaDegrees
  30. end
  31. end
  32. OpenSample('Features/EyeMaterial')
  33. -- in 18 steps of 10 degrees each, rotate the camera
  34. -- from 90 degrees to 270 degrees. at each step it will wait
  35. -- 1 second.
  36. MyAnimateCamera(90.0, 270.0, 18, 1.0)
  37. -- Here are two examples of leaving the camera at a particular angle.
  38. -- MyAnimateCamera(129.6, 129.6, 1, 1.0)
  39. -- MyAnimateCamera(90.0, 90.0, 1, 1.0)