Sha256: 858a4c4a5a5a50e47124fa6e245dc8816b26cf42b36b232aaeb69f21889716e8
Contents?: true
Size: 968 Bytes
Versions: 2
Compression:
Stored size: 968 Bytes
Contents
# vecmath.rb # The vecmath library provides Vec2D and Vec3D classes which can be # use in place of processing PVector, and provide a more rubylike interface. # Also included in the vecmath library is the ArcBall utility after:- # Ken Shoemake. Computer Graphics Laboratory. University of Pennsylvania. Philadelphia, PA # ==== Example Arcball usage see vecmath library in samples # def setup # ..... # camera(width/2.0, height/2.0, (height/2.0) / tan(PI*30.0 / 180.0), 0, 0, 0, 0, 1, 0) # @arcball = ArcBall.new(0, 0, min(width - 20, height - 20) * 0.8) # ..... # end # # def draw # ..... # update # some_render_code # ..... # end # # def update # theta, x, y, z = arcball.update # rotate(theta, x, y, z) # end # # def mouse_pressed # arcball.mouse_pressed(mouse_x, mouse_y) # end # # def mouse_dragged # arcball.mouse_dragged(mouse_x, mouse_y) # end require_relative 'lib/vec' require_relative 'lib/quaternion' require_relative 'lib/arcball'
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruby-processing-2.4.4 | library/vecmath/vecmath.rb |
ruby-processing-2.4.3 | library/vecmath/vecmath.rb |