Example #1
0
class pyPerlinNoise2DShader(StrokeShader):
	def __init__(self, freq = 10, amp = 10, oct = 4, seed = -1):
		StrokeShader.__init__(self)
		self.__noise = Noise(seed)
		self.__freq = freq
		self.__amp = amp
		self.__oct = oct
	def shade(self, stroke):
		it = stroke.stroke_vertices_begin()
		while not it.is_end:
			v = it.object
			vec = mathutils.Vector([v.projected_x, v.projected_y])
			nres = self.__noise.turbulence2(vec, self.__freq, self.__amp, self.__oct)
			v.point = (v.projected_x + nres, v.projected_y + nres)
			it.increment()
		stroke.update_length()
Example #2
0
class pyPerlinNoise2DShader(StrokeShader):
    def __init__(self, freq=10, amp=10, oct=4, seed=-1):
        StrokeShader.__init__(self)
        self.__noise = Noise(seed)
        self.__freq = freq
        self.__amp = amp
        self.__oct = oct

    def shade(self, stroke):
        it = stroke.stroke_vertices_begin()
        while not it.is_end:
            v = it.object
            vec = mathutils.Vector([v.projected_x, v.projected_y])
            nres = self.__noise.turbulence2(vec, self.__freq, self.__amp,
                                            self.__oct)
            v.point = (v.projected_x + nres, v.projected_y + nres)
            it.increment()
        stroke.update_length()
Example #3
0
 def __init__(self, freq=10, amp=10, oct=4, seed=-1):
     StrokeShader.__init__(self)
     self.__noise = Noise(seed)
     self.__freq = freq
     self.__amp = amp
     self.__oct = oct
Example #4
0
	def __init__(self, freq = 10, amp = 10, oct = 4, seed = -1):
		StrokeShader.__init__(self)
		self.__noise = Noise(seed)
		self.__freq = freq
		self.__amp = amp
		self.__oct = oct