DarkPikachu
Administrator
Game Hacker
Offline
[color=lime]The electric rat with the power of darkness and a scythe. >:3[/color]
Posts: 678
Brawl Friend Code: 4125-6026-5674
Text Color: lime
Glow Color: green
Glow Strength: 5
Show Custom Post Effects: Yes
RolePlay Characters: Riku<br/>(normal) { id : "NRU", };
Riku<br/>(normal) { id : "NRH", };
Riku<br/>(power) {
id : "PRU",
BG : {},
ava : {},
name : {},
text : {},
};
Riku<br/>(power) { id : "PRH", };
Riku<br/>(evil) { id : "ERU", };
Riku<br/>(evil) { id : "ERH", };
Riku<br/>(ulra) { id : "URU", };
Sparx { id : "Sparx", };
Neal { id : "Neal", };
Exp:410 { id : "410", };
Dark Pikachu { id : "DP", };
Wolf { id : "Wolf", };
Reaperchu { id : "Reaperchu", };
Spark { id : "Spark", };
Custom Smileys: [[":>:3:","32","32","https://ipfs.io/ipfs/QmNrnBRE8hujm36qhbzZLEFxu94g2bW9SgCh9e74QyN7Sf?filename=DarkPikaSmile.gif"],["::3:","32","32","https://ipfs.io/ipfs/QmdCgSvLYN2PwsfmHhjHzby79sNuDQfvUMWthmDFbQ6Mq1?filename=DarkPika.gif"],[":pika:","32","32","http://www.sherv.net/cm/emo/funny/1/pikachu.gif"],[":af:","32","32","http://forums.kc-mm.com/Smileys/default/Awesome_Face.png"],[":srs:","32","32","http://forums.kc-mm.com/Smileys/default/srs2.gif"],[":Riku:","30","30","https://ipfs.io/ipfs/QmfBGDRhdEiKM4Q7pLYmqwHyLpncbxvFjMvQHz1pdkg8C3?filename=NRU.png"],[":RikuH:","30","30","https://ipfs.io/ipfs/QmfQXHwMjMHFTCBgAkC1FiA654smUznie7moEei7wdmvZp?filename=NRH.png"],[":PRiku:","30","30","https://ipfs.io/ipfs/QmPtUsVPNEvxqzC8zYd3rvEAN5V53UFhzWZXW741B5WgyE?filename=PRU.png"],[":PRikuH:","30","30","https://ipfs.io/ipfs/QmX8LsJaerTtmYmrkJPbq2bNsaEkT2iABbYhEUavMw92Lf?filename=PRH.png"],[":ERiku:","30","30","https://ipfs.io/ipfs/QmRuGxcH3MihCPu4BWvzbHGjHdPraNK4RN9c8nzLVXT7wQ?filename=ERU.png"],[":ERikuH:","30","30","https://ipfs.io/ipfs/QmZJaLSAMqiy9vZsaYTCZNtte1PoRXpjtoKT4yvw3ajbMZ?filename=ERH.png"],[":URiku:","30","30","https://ipfs.io/ipfs/QmcmnfgrjgSKwfxmMbdD852YtWwZijVT9QCUHV3zw1Rvj3?filename=URU.png"],[":DRiku:","30","30","https://ipfs.io/ipfs/QmQ5dYfKh29bS7f6YKG3KkXRCxgR6GvN3yAQFNqo58C5mE?filename=DRU.png"],[":DP:","30","30","https://ipfs.io/ipfs/QmSCHr21hYqdF1H56gKdwoQ9eVfUZS2AqFpDwFFTKRiEXc?filename=avatar174258_1.png"],[":Wolf:","30","30","https://ipfs.io/ipfs/QmV6JreKeTNZ3AFP6SwbXQZRGyr1XD7FjNUKd8DX7NDEzR?filename=wolf.png"],[":dp:","30","30","https://ipfs.io/ipfs/QmW8mGxQXyopCFkQbMFxtaseZdY1febCqVTwgBViFuoDxj?filename=409852902098862080.png"],[":smirk:","32","32","https://ipfs.io/ipfs/QmcEpjdS73RHrHgxgLQidQKUFQCVFxZVwv54gCjrT2oAeu?filename=smirk.png"]]
Custom CSS:
.blank { color: silver; text-shadow: none; }
.staff { color: gray; text-shadow: none; }
.SoneH { color: lightblue; text-shadow:
0px 0px 3px lightblue,
0px 0px 3px lightblue,
0px 0px 3px lightblue; }
.Riku, .RikuH { color: #CC8140; text-shadow: none; }
.PRiku, .PRikuH { color: #6688DD; text-shadow:
0px 0px 3px #2244DD,
0px 0px 3px #2244DD,
0px 0px 3px #2244DD; }
.ERiku, .ERikuH { color: #C70000; text-shadow:
0px 0px 2px #6644DD,
0px 0px 2px #6644DD; }
.URiku { color: #9988DD; text-shadow:
0px 0px 3px #772288,
0px 0px 3px #772288,
0px 0px 3px #772288; }
.DRiku { color: #60FF60; text-shadow:
0px 0px 3px #608070,
0px 0px 3px #608070,
0px 0px 3px #608070; }
.DP { color: lime; text-shadow: green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px; }
.Wolf { color: #F090F0; text-shadow:
0px 0px 3px #772288,
0px 0px 3px #772288,
0px 0px 3px #772288; }
|
Post by DarkPikachu on Feb 12, 2014 0:42:32 GMT -5
So I figured I'd use one of the slowest rendering systems out there for Python called Tkinter, which is more of a GUI API than a REAL rendering API. anyways, I figured I'd use it to test my 3D rendering system on just to see how fast I can make it. so I did some F-ing around with an example I found on google and ended up with something that simply draws an interesting pattern using math: I'll be honest, I had no idea what I was doing... I was trying to animate it. :P so anyways, here's the src of those results: ### only a test from Tkinter import Tk, Canvas, PhotoImage, mainloop from math import sin
WIDTH, HEIGHT = 640, 480
window = Tk() canvas = Canvas(window, width=WIDTH, height=HEIGHT, bg="#000000") canvas.pack() img = PhotoImage(width=WIDTH, height=HEIGHT) canvas.create_image((WIDTH/2, HEIGHT/2), image=img, state="normal")
for x in range(WIDTH*4): y = int((HEIGHT*0.5) + (HEIGHT*0.25) * sin(x/2)) img.put("#ffffff", (x//4,y))
mainloop()
def dummy_function_to_make_this_syntax_highlight_properly(): pass
pretty simple for a complex pattern huh... :P I hope to get it to draw a shaded sphere on the screen in the future. (no vertices or voxels... only math)
|
|
|
DarkPikachu
Administrator
Game Hacker
Offline
[color=lime]The electric rat with the power of darkness and a scythe. >:3[/color]
Posts: 678
Brawl Friend Code: 4125-6026-5674
Text Color: lime
Glow Color: green
Glow Strength: 5
Show Custom Post Effects: Yes
RolePlay Characters: Riku<br/>(normal) { id : "NRU", };
Riku<br/>(normal) { id : "NRH", };
Riku<br/>(power) {
id : "PRU",
BG : {},
ava : {},
name : {},
text : {},
};
Riku<br/>(power) { id : "PRH", };
Riku<br/>(evil) { id : "ERU", };
Riku<br/>(evil) { id : "ERH", };
Riku<br/>(ulra) { id : "URU", };
Sparx { id : "Sparx", };
Neal { id : "Neal", };
Exp:410 { id : "410", };
Dark Pikachu { id : "DP", };
Wolf { id : "Wolf", };
Reaperchu { id : "Reaperchu", };
Spark { id : "Spark", };
Custom Smileys: [[":>:3:","32","32","https://ipfs.io/ipfs/QmNrnBRE8hujm36qhbzZLEFxu94g2bW9SgCh9e74QyN7Sf?filename=DarkPikaSmile.gif"],["::3:","32","32","https://ipfs.io/ipfs/QmdCgSvLYN2PwsfmHhjHzby79sNuDQfvUMWthmDFbQ6Mq1?filename=DarkPika.gif"],[":pika:","32","32","http://www.sherv.net/cm/emo/funny/1/pikachu.gif"],[":af:","32","32","http://forums.kc-mm.com/Smileys/default/Awesome_Face.png"],[":srs:","32","32","http://forums.kc-mm.com/Smileys/default/srs2.gif"],[":Riku:","30","30","https://ipfs.io/ipfs/QmfBGDRhdEiKM4Q7pLYmqwHyLpncbxvFjMvQHz1pdkg8C3?filename=NRU.png"],[":RikuH:","30","30","https://ipfs.io/ipfs/QmfQXHwMjMHFTCBgAkC1FiA654smUznie7moEei7wdmvZp?filename=NRH.png"],[":PRiku:","30","30","https://ipfs.io/ipfs/QmPtUsVPNEvxqzC8zYd3rvEAN5V53UFhzWZXW741B5WgyE?filename=PRU.png"],[":PRikuH:","30","30","https://ipfs.io/ipfs/QmX8LsJaerTtmYmrkJPbq2bNsaEkT2iABbYhEUavMw92Lf?filename=PRH.png"],[":ERiku:","30","30","https://ipfs.io/ipfs/QmRuGxcH3MihCPu4BWvzbHGjHdPraNK4RN9c8nzLVXT7wQ?filename=ERU.png"],[":ERikuH:","30","30","https://ipfs.io/ipfs/QmZJaLSAMqiy9vZsaYTCZNtte1PoRXpjtoKT4yvw3ajbMZ?filename=ERH.png"],[":URiku:","30","30","https://ipfs.io/ipfs/QmcmnfgrjgSKwfxmMbdD852YtWwZijVT9QCUHV3zw1Rvj3?filename=URU.png"],[":DRiku:","30","30","https://ipfs.io/ipfs/QmQ5dYfKh29bS7f6YKG3KkXRCxgR6GvN3yAQFNqo58C5mE?filename=DRU.png"],[":DP:","30","30","https://ipfs.io/ipfs/QmSCHr21hYqdF1H56gKdwoQ9eVfUZS2AqFpDwFFTKRiEXc?filename=avatar174258_1.png"],[":Wolf:","30","30","https://ipfs.io/ipfs/QmV6JreKeTNZ3AFP6SwbXQZRGyr1XD7FjNUKd8DX7NDEzR?filename=wolf.png"],[":dp:","30","30","https://ipfs.io/ipfs/QmW8mGxQXyopCFkQbMFxtaseZdY1febCqVTwgBViFuoDxj?filename=409852902098862080.png"],[":smirk:","32","32","https://ipfs.io/ipfs/QmcEpjdS73RHrHgxgLQidQKUFQCVFxZVwv54gCjrT2oAeu?filename=smirk.png"]]
Custom CSS:
.blank { color: silver; text-shadow: none; }
.staff { color: gray; text-shadow: none; }
.SoneH { color: lightblue; text-shadow:
0px 0px 3px lightblue,
0px 0px 3px lightblue,
0px 0px 3px lightblue; }
.Riku, .RikuH { color: #CC8140; text-shadow: none; }
.PRiku, .PRikuH { color: #6688DD; text-shadow:
0px 0px 3px #2244DD,
0px 0px 3px #2244DD,
0px 0px 3px #2244DD; }
.ERiku, .ERikuH { color: #C70000; text-shadow:
0px 0px 2px #6644DD,
0px 0px 2px #6644DD; }
.URiku { color: #9988DD; text-shadow:
0px 0px 3px #772288,
0px 0px 3px #772288,
0px 0px 3px #772288; }
.DRiku { color: #60FF60; text-shadow:
0px 0px 3px #608070,
0px 0px 3px #608070,
0px 0px 3px #608070; }
.DP { color: lime; text-shadow: green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px; }
.Wolf { color: #F090F0; text-shadow:
0px 0px 3px #772288,
0px 0px 3px #772288,
0px 0px 3px #772288; }
|
Post by DarkPikachu on Feb 12, 2014 2:10:09 GMT -5
ok... got something animated before going to bed. it's pretty fast too :)
from Tkinter import Tk, Canvas, PhotoImage, mainloop from math import sin import random
WIDTH, HEIGHT = 640, 480
root = Tk() canvas = Canvas(root, width=WIDTH, height=HEIGHT, bg="#000000") canvas.pack()
img = PhotoImage(width=WIDTH, height=HEIGHT) canvas.create_image((WIDTH/2, HEIGHT/2), image=img, state="normal")
def do_animation(): #print 1 global img img.blank() for x in range(WIDTH): y = random.randrange((HEIGHT/4), (HEIGHT/2)+(HEIGHT/4)) img.put("#ffffff", (x,y))
canvas.update_idletasks() root.after(0, do_animation) root.after(0, do_animation) mainloop()
|
|
|
|
Post by tatatat0 on Mar 15, 2016 0:11:09 GMT -5
So I figured I'd use one of the slowest rendering systems out there for Python called Tkinter, which is more of a GUI API than a REAL rendering API. anyways, I figured I'd use it to test my 3D rendering system on just to see how fast I can make it. so I did some F-ing around with an example I found on google and ended up with something that simply draws an interesting pattern using math: I'll be honest, I had no idea what I was doing... I was trying to animate it. :P so anyways, here's the src of those results: ### only a test from Tkinter import Tk, Canvas, PhotoImage, mainloop from math import sin
WIDTH, HEIGHT = 640, 480
window = Tk() canvas = Canvas(window, width=WIDTH, height=HEIGHT, bg="#000000") canvas.pack() img = PhotoImage(width=WIDTH, height=HEIGHT) canvas.create_image((WIDTH/2, HEIGHT/2), image=img, state="normal")
for x in range(WIDTH*4): y = int((HEIGHT*0.5) + (HEIGHT*0.25) * sin(x/2)) img.put("#ffffff", (x//4,y))
mainloop()
def dummy_function_to_make_this_syntax_highlight_properly(): pass
pretty simple for a complex pattern huh... :P I hope to get it to draw a shaded sphere on the screen in the future. (no vertices or voxels... only math) Oh my lord. The moment I saw sin() in the math, it gave me nightmares instantly of when I had to a create a function to have a projectile be launched from an enemy on a 2d grid towards the player at a set speed by combining vertical and horizontal velocity. def shoot_player(self): #shoots at the player. Returns whether it was successful
#CRAZY Math
#From position of player and enemy form a triangle
#self.anchor is the enemy(monster)
#self.anchor.x_pos & self.anchor.y_pos is the monster's position on the grid
#map.characters[0] is the player
#its position on the map(grid) is (map.characters[0].x_pos, map.characters[0].y_pos)
x_distance = self.anchor.x_pos - map.characters[0].x_pos #leg of a triangle
y_distance = self.anchor.y_pos - map.characters[0].y_pos #leg of a triangle
if not (x_distance == 0 or y_distance == 0): #won't shoot a projectile with no velocity
slope = y_distance / x_distance
angle = math.atan(slope)
vel_x = -(math.cos(angle) * self.velocity)
vel_y = (math.sin(angle) * self.velocity) #self.velocity = .35 if self.anchor.x_pos < map.characters[0].x_pos: #reverses velocity when needed
vel_x = -(vel_x)
vel_y = -(vel_y)
#creates projectile on the map
map.projectiles.append(Projectile(self.anchor.x_pos,self.anchor.y_pos,current_time + 2,float(self.anchor.x_pos),float(self.anchor.y_pos),vel_x,vel_y,Sprite("+"),"archer_arrow",3,self.anchor.self,1))
return True
else:
return False
|
DarkPikachu likes this
|
|
DarkPikachu
Administrator
Game Hacker
Offline
[color=lime]The electric rat with the power of darkness and a scythe. >:3[/color]
Posts: 678
Brawl Friend Code: 4125-6026-5674
Text Color: lime
Glow Color: green
Glow Strength: 5
Show Custom Post Effects: Yes
RolePlay Characters: Riku<br/>(normal) { id : "NRU", };
Riku<br/>(normal) { id : "NRH", };
Riku<br/>(power) {
id : "PRU",
BG : {},
ava : {},
name : {},
text : {},
};
Riku<br/>(power) { id : "PRH", };
Riku<br/>(evil) { id : "ERU", };
Riku<br/>(evil) { id : "ERH", };
Riku<br/>(ulra) { id : "URU", };
Sparx { id : "Sparx", };
Neal { id : "Neal", };
Exp:410 { id : "410", };
Dark Pikachu { id : "DP", };
Wolf { id : "Wolf", };
Reaperchu { id : "Reaperchu", };
Spark { id : "Spark", };
Custom Smileys: [[":>:3:","32","32","https://ipfs.io/ipfs/QmNrnBRE8hujm36qhbzZLEFxu94g2bW9SgCh9e74QyN7Sf?filename=DarkPikaSmile.gif"],["::3:","32","32","https://ipfs.io/ipfs/QmdCgSvLYN2PwsfmHhjHzby79sNuDQfvUMWthmDFbQ6Mq1?filename=DarkPika.gif"],[":pika:","32","32","http://www.sherv.net/cm/emo/funny/1/pikachu.gif"],[":af:","32","32","http://forums.kc-mm.com/Smileys/default/Awesome_Face.png"],[":srs:","32","32","http://forums.kc-mm.com/Smileys/default/srs2.gif"],[":Riku:","30","30","https://ipfs.io/ipfs/QmfBGDRhdEiKM4Q7pLYmqwHyLpncbxvFjMvQHz1pdkg8C3?filename=NRU.png"],[":RikuH:","30","30","https://ipfs.io/ipfs/QmfQXHwMjMHFTCBgAkC1FiA654smUznie7moEei7wdmvZp?filename=NRH.png"],[":PRiku:","30","30","https://ipfs.io/ipfs/QmPtUsVPNEvxqzC8zYd3rvEAN5V53UFhzWZXW741B5WgyE?filename=PRU.png"],[":PRikuH:","30","30","https://ipfs.io/ipfs/QmX8LsJaerTtmYmrkJPbq2bNsaEkT2iABbYhEUavMw92Lf?filename=PRH.png"],[":ERiku:","30","30","https://ipfs.io/ipfs/QmRuGxcH3MihCPu4BWvzbHGjHdPraNK4RN9c8nzLVXT7wQ?filename=ERU.png"],[":ERikuH:","30","30","https://ipfs.io/ipfs/QmZJaLSAMqiy9vZsaYTCZNtte1PoRXpjtoKT4yvw3ajbMZ?filename=ERH.png"],[":URiku:","30","30","https://ipfs.io/ipfs/QmcmnfgrjgSKwfxmMbdD852YtWwZijVT9QCUHV3zw1Rvj3?filename=URU.png"],[":DRiku:","30","30","https://ipfs.io/ipfs/QmQ5dYfKh29bS7f6YKG3KkXRCxgR6GvN3yAQFNqo58C5mE?filename=DRU.png"],[":DP:","30","30","https://ipfs.io/ipfs/QmSCHr21hYqdF1H56gKdwoQ9eVfUZS2AqFpDwFFTKRiEXc?filename=avatar174258_1.png"],[":Wolf:","30","30","https://ipfs.io/ipfs/QmV6JreKeTNZ3AFP6SwbXQZRGyr1XD7FjNUKd8DX7NDEzR?filename=wolf.png"],[":dp:","30","30","https://ipfs.io/ipfs/QmW8mGxQXyopCFkQbMFxtaseZdY1febCqVTwgBViFuoDxj?filename=409852902098862080.png"],[":smirk:","32","32","https://ipfs.io/ipfs/QmcEpjdS73RHrHgxgLQidQKUFQCVFxZVwv54gCjrT2oAeu?filename=smirk.png"]]
Custom CSS:
.blank { color: silver; text-shadow: none; }
.staff { color: gray; text-shadow: none; }
.SoneH { color: lightblue; text-shadow:
0px 0px 3px lightblue,
0px 0px 3px lightblue,
0px 0px 3px lightblue; }
.Riku, .RikuH { color: #CC8140; text-shadow: none; }
.PRiku, .PRikuH { color: #6688DD; text-shadow:
0px 0px 3px #2244DD,
0px 0px 3px #2244DD,
0px 0px 3px #2244DD; }
.ERiku, .ERikuH { color: #C70000; text-shadow:
0px 0px 2px #6644DD,
0px 0px 2px #6644DD; }
.URiku { color: #9988DD; text-shadow:
0px 0px 3px #772288,
0px 0px 3px #772288,
0px 0px 3px #772288; }
.DRiku { color: #60FF60; text-shadow:
0px 0px 3px #608070,
0px 0px 3px #608070,
0px 0px 3px #608070; }
.DP { color: lime; text-shadow: green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px, green 0px 0px 5px; }
.Wolf { color: #F090F0; text-shadow:
0px 0px 3px #772288,
0px 0px 3px #772288,
0px 0px 3px #772288; }
|
Post by DarkPikachu on Mar 15, 2016 8:39:12 GMT -5
haha, yea, my src was originally testing some 2D stuff, but I wanted to make it draw something like a 3D egg :P
the whole idea is to draw in 3D w/o using vertices, which is why I went with Tkinter rather than OpenGL... heh *reads* oh, I said that already... haha
|
|
|