Spiky white light of death! (participating media test)

Get feedback from others on your works in progress
User avatar
Stur
Posts: 594
Joined: Fri Nov 10, 2006 11:52 pm
Location: Nancy, France

Post by Stur » Fri Sep 14, 2007 5:06 am

Cool 8)

IanC
Posts: 147
Joined: Thu Aug 24, 2006 4:46 am

Post by IanC » Sat Sep 15, 2007 1:29 pm

Here you go Kram and people:

Code: Select all

import Blender
from Blender import Mesh,Scene
from time import time



scn=Scene.GetCurrent()

def generate(location, scale, level, currentVerts,currentFaces):
	
	for i in range(32):
		currentVerts.append([i,0.1*i**2,0])
		if i>0:
			currentFaces.append([i-1,i])
	return [currentVerts,currentFaces]


t=time()

i=1
v,f=generate([0,0,2],1,0,[],[])
level=Mesh.New(str(i)+'level')
level.verts.extend(v)
level.faces.extend(f)
ob=scn.objects.new(level,'lensShape')
ob.setLocation([i*2,0,0])
print "It took %2.2fs"%(time()-t)
Blender.Redraw()
It's awful code, but it'll make one side of a parabola for you. Scale it down and shape the other side if you want, or make it flat, whatever, then spin it.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Sep 18, 2007 4:13 am

ah!
I searched it for three days, now, as I forgot, which thread it was xD
I saw your chat box message, though.
(for some reason, this thread wasn't even marked orange O.o :?)
thank you, very much :)

Post Reply
33 posts

Who is online

Users browsing this forum: No registered users and 42 guests