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 11, 2014 11:34:23 GMT -5
While 3D modeling HAS proven to be very useful and accurate in it's time, it's just way too much data to have to send into a GPU, and expect real-time results for an extremely high-detail model. So how can we greatly reduce the amount of data? the answer is very simple. Say we have an ICO sphere made OUT OF 642 verts: (set smooth) looks pretty decent right? lets have another look: (set solid) This is where the problem lies, and how it's nearly impossible to create a decent HQ model w/o overloading the GPU. so we have 642 verts here, but yet we can do even better to achieve something like this, with only 1 equation: (vertex count: 163842; set solid) drawing models using mathematic equations, instead of vertices or voxels, WILL allow the use of nearly (if not exactly) real-looking 3D graphics for use in video games.
|
|
|
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 11, 2014 11:34:38 GMT -5
the original idea started out as what I called "Dynamic Meshes" a few years back, (this was basically the idea of using curves in a similar fascion as surfaces, but processing per face/edge instead of per point) and I even had a horrid editor built for it using bezier curves: (in the first image, orange means active-selection, blue means co-selection) other images of past ideas: (drawn with MS Paint) later images: (plausable idea) The idea was scrapped after I got it working fully here's an image showing progress BEFORE I got it working: unfortunately I lost the updated src to a RAW HDD (recovery shows nothing in the folders), so I can't capture a more recent image, nor release the src for it. :(
|
|
|
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 11, 2014 11:34:51 GMT -5
This idea then evolved from that and can fully be performed on todays systems via pixel shaders. basically, you can skip the whole vertex processing section since we're not using them, and forward the model equations directly to the pixel shaders. the idea revolved around using a 2D radius and modifying the length of the radius at specific angles, seen here: code: from Tkinter import Tk, Canvas, PhotoImage, mainloop from math import sqrt, pi, sin, cos 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 px(R,G,B,x,y): img.put('#%06x'%((R<<16)|(G<<8)|B), (x,y) )
def DrawLine(x1, y1, x2, y2, R,G,B): delta_x = x2 - x1 # if x1 == x2, then it does not matter what we set here ix = ((delta_x > 0) - (delta_x < 0)) delta_x = abs(delta_x) << 1 delta_y = y2 - y1 # if y1 == y2, then it does not matter what we set here iy = ((delta_y > 0) - (delta_y < 0)) delta_y = abs(delta_y) << 1 px(R,G,B, int(x1), int(y1)) if (delta_x >= delta_y): error = (delta_y - (delta_x >> 1)) # may go below zero while (x1 != x2): if ((error >= 0) and (error or (ix > 0))): error -= delta_x; y1 += iy # else do nothing error += delta_y; x1 += ix px(R,G,B, int(x1), int(y1)) else: error = (delta_x - (delta_y >> 1)) # may go below zero while (y1 != y2): if ((error >= 0) and (error or (iy > 0))): error -= delta_y; x1 += ix # else do nothing error += delta_x; y1 += iy px(R,G,B, int(x1), int(y1))
frac = (2*pi)/359 def DrawCircle(x0, y0, radius, mod=None): _x,_y = [],[]
apr = 0.01 init = True angle=0 while angle <= frac*359: x=int( x0+ cos(angle)*radius ) y=int( y0+ sin(angle)*radius )
#this should be done using a spheracle heirarchial extension #(think of a belt across 2 pullies) if angle > frac*180 : y += int( sin(angle)*40 )
if 0<=x<=WIDTH and 0<=y<=HEIGHT: px(255,255,255, x,y) _x.append(x) _y.append(y) angle+=apr return _x,_y cx,cy = WIDTH/2, HEIGHT/2 dx,dy = 2,2 crx,cry = 50,80
ran1, ran2 = 4,8
def do_animation(): global img, frac global cx,cy,dx,dy, crx,cry global cx2,cy2,dx2,dy2, cr2 img.blank()
c1px,c1py = DrawCircle(cx,cy, crx) ''' #outer physics if WIDTH in c1px: dx = -random.randrange(ran1, ran2) elif 0 in c1px: dx = random.randrange(ran1, ran2) if HEIGHT in c1py: dy = -random.randrange(ran1, ran2) elif 0 in c1py: dy = random.randrange(ran1, ran2) cx+=dx cy+=dy #''' canvas.update_idletasks() root.after(0, do_animation)
root.after(0, do_animation) mainloop()
(let me know if this DOESN'T work) as well as applying recursive math at those angles to form something like an arm or 2 spheres linked to each other, seen here: code: from Tkinter import Tk, Canvas, PhotoImage, mainloop from math import sqrt, pi, sin, cos 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 px(R,G,B,x,y): img.put('#%06x'%((R<<16)|(G<<8)|B), (x,y) )
def DrawLine(x1, y1, x2, y2, R,G,B): delta_x = x2 - x1 # if x1 == x2, then it does not matter what we set here ix = ((delta_x > 0) - (delta_x < 0)) delta_x = abs(delta_x) << 1 delta_y = y2 - y1 # if y1 == y2, then it does not matter what we set here iy = ((delta_y > 0) - (delta_y < 0)) delta_y = abs(delta_y) << 1 px(R,G,B, int(x1), int(y1)) if (delta_x >= delta_y): error = (delta_y - (delta_x >> 1)) # may go below zero while (x1 != x2): if ((error >= 0) and (error or (ix > 0))): error -= delta_x; y1 += iy # else do nothing error += delta_y; x1 += ix px(R,G,B, int(x1), int(y1)) else: error = (delta_x - (delta_y >> 1)) # may go below zero while (y1 != y2): if ((error >= 0) and (error or (iy > 0))): error -= delta_y; x1 += ix # else do nothing error += delta_x; y1 += iy px(R,G,B, int(x1), int(y1))
def DrawEllipse(x0, y0, width, height): a2 = width * width b2 = height * height fa2 = 4 * a2 fb2 = 4 * b2 #int x0, y0, x, y, sigma;
#/* first half */ x = 0; y = height sigma = 2*b2+a2*(1-2*height) while b2*x <= a2*y: px(0xff, 0xff, 0xff, int(x + x0), int(y + y0)) img.put("#ffffff", (int(x - x0), int(y + y0))) img.put("#ffffff", (int(x + x0), int(y - y0))) img.put("#ffffff", (int(x - x0), int(y - y0))) if (sigma >= 0): sigma += fa2 * (1 - y); y-=1 sigma += b2 * ((4 * x) + 6); x+=1
#/* second half */ x = width; y = 0 sigma = 2*a2+b2*(1-2*width) while a2*y <= b2*x: img.put("#ffffff", (int(x + x0), int(y + y0))) img.put("#ffffff", (int(x - x0), int(y + y0))) img.put("#ffffff", (int(x + x0), int(y - y0))) img.put("#ffffff", (int(x - x0), int(y - y0))) if (sigma >= 0): sigma += fb2 * (1 - x); x-=1 sigma += a2 * ((4 * y) + 6); y+=1
frac = (2*pi)/359 def DrawCircle(x0, y0, radius, mod=None): _x,_y = [],[]
apr = 0.01 init = True angle=0 while angle <= frac*359: x=int( x0+ cos(angle)*radius ) y=int( y0+ sin(angle)*radius )
#this should be done using a spheracle heirarchial extension #(think of a belt across 2 pullies) if frac*345 > angle > frac*195 : #y += int( sin(angle)*40 ) DrawLine( x,y, x,y, 64,64,64) if init: PX,PY = x,y x=int( x0+ cos(angle)*30 ) y=int( (y0-90)+ sin(angle)*30 )
DrawLine( x0,y0-90, x,y, 48,48,48)
#this is what I want the radius to do: if init: DrawLine(PX,PY, x,y, 255,255,255); init=False
DrawLine(x0,y0, x0,y0-90, 255,0,0) DrawLine(x0,y0-90, x0,y0-90, 255,255,0) else: x2=int( x0+ cos(angle)*30 ) y2=int( (y0-90)+ sin(angle)*30 ) DrawLine( x2,y2, x2,y2, 64,64,64) DrawLine( x0,y0, x,y, 48,48,48)
if 0<=x<=WIDTH and 0<=y<=HEIGHT: px(255,255,255, x,y) _x.append(x) _y.append(y) angle+=apr
DrawLine( x0,y0, x0+radius,y0, 0,180,180) DrawLine(x0,y0, x0,y0, 255,255,0) return _x,_y
def clsnTest( r1, x1,y1, vx1,vy1, r2, x2,y2, vx2,vy2 ): t = 0.0
class obj(object):
rad = 0.0 x,y = 0.0,0.0 vx,vy = 0.0,0.0 cx,cy = WIDTH/2, HEIGHT/2 dx,dy = 2,2 crx,cry = 50,80
cx2,cy2 = WIDTH/4, HEIGHT/2 dx2,dy2 = -2,-2 cr2 = crx/3
ran1, ran2 = 4,8
def do_animation(): global img, frac global cx,cy,dx,dy, crx,cry global cx2,cy2,dx2,dy2, cr2 img.blank()
#DrawLine(0, 0, WIDTH/2, HEIGHT/2, 255,0,0) #DrawEllipse(cx,cy, crx,cry) c1px,c1py = DrawCircle(cx,cy, crx) #c2px,c2py = DrawCircle(cx2,cy2, cr2) ''' #outer physics if WIDTH in c1px: dx = -random.randrange(ran1, ran2) elif 0 in c1px: dx = random.randrange(ran1, ran2) if HEIGHT in c1py: dy = -random.randrange(ran1, ran2) elif 0 in c1py: dy = random.randrange(ran1, ran2) cx+=dx cy+=dy #''' ''' #inner physics l = sqrt(((cx-cx2)+(cy-cy2))**2) if l >= crx-cr2: if cx2<0: dx2 = -random.randrange(ran1, ran2) if cx2>0: dx2 = random.randrange(ran1, ran2) if cy2<0: dy2 = -random.randrange(ran1, ran2) if cy2>0: dy2 = random.randrange(ran1, ran2) cx2+=dx2 cy2+=dy2 ''' canvas.update_idletasks() root.after(0, do_animation)
root.after(0, do_animation) mainloop()
^ not cleaned (lots of junk code) NOTE: I am by NO MEANS a math expert, and hardly know anything above basic geometry. (I had to struggle and google to get things working like THIS) I'm gonna post my idea on Khronos (OpenGL) forums, and see if I can gain some help from some of them. The only thing I have to lean on here is my impressively logical mind. (thanks to my autism... heh) a few other tests I intend to try: and for final expectations, I intend to animate a character like this: I just hope I'll be able to comprehend all the math going into this... heh #_#
|
|
|