Sha256: a38890e91cc4e73cf1328367002089cf6dd977ade084759e15e7fbac5ed7bd8c

Contents?: true

Size: 339 Bytes

Versions: 3

Compression:

Stored size: 339 Bytes

Contents

#! /usr/bin/env ruby # coding: utf-8

class Mageo::Sphere
  # povray 形式の文字列を返す。
  # color は Float による配列。通常、0〜1の範囲。
  def to_pov(color)
    sprintf( "object { sphere{<% 7.4f, % 7.4f, % 7.4f>, %7.4f} pigment {color rgb <%4.2f, %4.2f, %4.2f>} }",
      *position, radius, *color)
  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
crystalcell-0.0.6 lib/crystalcell/povray/sphere.rb
crystalcell-0.0.5 lib/crystalcell/povray/sphere.rb
crystalcell-0.0.4 lib/crystalcell/povray/sphere.rb