Sha256: e57cdede4de5759e6b429d2cdac9fa578957e55b082277e602c1af946562327c

Contents?: true

Size: 1.04 KB

Versions: 20

Compression:

Stored size: 1.04 KB

Contents

#
# Copyright (c) 2001 by Jim Menard <jimm@io.com>
#
# Released under the same license as Ruby. See
# http://www.ruby-lang.org/en/LICENSE.txt.
#

require 'Qt'
require './View'
require './Cloud'
require './Params'
require './World'
require './Graphics'

class CloudView < View

    def initialize(cloud)
	super(cloud)
    end

    def makeObject
	@object = GenLists(1)
	NewList(@object, COMPILE)

	@model.bubbles.each { | bubble |
  	    Color(bubble.color)
	    PushMatrix()
	    Translate(bubble.loc.x, bubble.loc.y, bubble.loc.z)
	    Scale(bubble.radius, bubble.radius, bubble.radius)
	    Graphics.sphere()
	    PopMatrix()
	}

	EndList()
    end

    def makeShadow
	@shadow = GenLists(1)
	NewList(@shadow, COMPILE)

	groundLevel = -($PARAMS['world_height'] / 2) + 1
	@model.bubbles.each { | bubble |
  	    Color(shadowColorForHeight(model.position.y + bubble.loc.y))
	    PushMatrix()
	    Translate(bubble.loc.x, groundLevel, bubble.loc.z)
	    Scale(bubble.radius, 1.0, bubble.radius)
	    Graphics.circle(2)
	    PopMatrix()
	}

	EndList()
    end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rock-qtbindings-4.8.6.5 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.6.5 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.6.4 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.6.2 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.6.1 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.6.0 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.6.0-x86-mingw32 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.5.2 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.5.2-x86-mingw32 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.5.1 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.5.0 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.3.0-x86-mingw32 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.8.3.0 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.4-x86-mingw32 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.4 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.3 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.2-x86-mingw32 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.2 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.1 examples/ruboids/ruboids/CloudView.rb
qtbindings-4.6.3.1-x86-mingw32 examples/ruboids/ruboids/CloudView.rb