| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Aug 2003
Posts: 116
|
this is a comparatively easy challenge. anything in a 3d world. As many lines as you wish.
and heres mine. You can download here as a text file http://www.geocities.com/hairybobby2000/fx3ids.html or cut and paste from the browser here _root.createEmptyMovieClip("grad", 1); with (_root.grad) { _x = 200; _y = 100; onEnterFrame = function () { if (yyy == undefined) { yyy = 1; xxx = 1; } yyy += ((_ymouse-_y)/40); xxx += ((_xmouse-_x)/40); Clear(); lineStyle(1, 0xefcefc, 100); p1x = [-141, -111, -141, -14, 33, 48, 32, -15, 176, 123, 113, 124, 168, 176, 170]; p1y = [-7, -7, 32, -7, -7, 15, 32, 31, -8, -8, 8, 14, 13, 21, 31]; p2x = [66, 147, -43, 43, 50, 50, 107, 52, 37, 109, 116, 145, 175, 176, 164]; p2y = [204, 160, 33, 104, -3, 27, 68, 96, 61, -5, 15, 29, 13, 30, 101]; p3x = [-81, -111, -81, 33, 48, 32, -15, -14, 123, 113, 124, 168, 176, 170, 116]; p3y = [-7, 32, 31, -7, 15, 32, 31, -6, -8, 8, 14, 13, 21, 31, 32]; for (i=0; i<p1x.length; i++) { for (ii=1; ii<4; ii++) { if (ii == 1) { xx = 0; yy = p1x[i]; zz = p1y[i]; } if (ii == 2) { xx = 0; yy = p2x[i]; zz = p2y[i]; } if (ii == 3) { xx = 0; yy = p3x[i]; zz = p3y[i]; } tempz = (zz*Math.cos(yyy*0.0175))-xx*(Math.sin(yyy*0.0175)); newx = (yy*Math.sin(xxx*0.0175))+tempz*(Math.cos(xxx*0.01 75)); newy = (zz*Math.sin(yyy*0.0175))+xx*(Math.cos(yyy*0.0175) ); newz = (yy*Math.cos(xxx*0.0175))-tempz*(Math.sin(xxx*0.0175)); newx = 133+newx+(newz/10); newy = 133+newy+(newz/10); if (ii == 1) { p1x[i] = newx; p1y[i] = newy; } if (ii == 2) { p2x[i] = newx; p2y[i] = newy; } if (ii == 3) { p3x[i] = newx; p3y[i] = newy; } } } MoveTo(p1x[0], p1y[0]); LineTo(p3x[0], p3y[0]); MoveTo(p1x[1], p1y[1]); LineTo(p3x[1], p3y[1]); MoveTo(p1x[2], p1y[2]); LineTo(p3x[2], p3y[2]); MoveTo(p1x[3], p1y[3]); LineTo(p3x[3], p3y[3]); curveTo(p2x[4], p2y[4], p3x[4], p3y[4]); curveTo(p2x[5], p2y[5], p3x[5], p3y[5]); LineTo(p3x[6], p3y[6]); LineTo(p3x[7], p3y[7]); MoveTo(p1x[8], p1y[8]); LineTo(p3x[8], p3y[8]); curveTo(p2x[9], p2y[9], p3x[9], p3y[9]); curveTo(p2x[10], p2y[10], p3x[10], p3y[10]); LineTo(p3x[11], p3y[11]); curveTo(p2x[12], p2y[12], p3x[12], p3y[12]); curveTo(p2x[13], p2y[13], p3x[13], p3y[13]); LineTo(p3x[14], p3y[14]); duplicateMovieClip(_root[this], "g2", 11); }; } Last edited by vulcanpimp; 10-01-2003 at 10:30 AM.. |
|
|
|
|
|
#3 |
|
Registered User
Join Date: Aug 2003
Posts: 116
|
well I kinda thought 3d was easy. I know the 3d I use is pretty simple it amounts to just 6 lines
tempz = (zz*Math.cos(yyy*0.0175))-xx*(Math.sin(yyy*0.0175)); newx = (yy*Math.sin(xxx*0.0175))+tempz*(Math.cos(xxx*0.01 75)); newy = (zz*Math.sin(yyy*0.0175))+xx*(Math.cos(yyy*0.0175) ); newz = (yy*Math.cos(xxx*0.0175))-tempz*(Math.sin(xxx*0.0175)); newx = 133+newx+(newz/10); newy = 133+newy+(newz/10); But I know a lot of 3d demos in flash have about 10 different functions in which can basically just slow things down. But to me its just a matter of xyz positions and an xyz rotation. I know theres this example on my site which shows 3d in its basic form http://www.geocities.com/hairybobby2000/fx3d1.html that just moves a point in a 3d world. Then to build a vector shape you just do it in 3d then revolve it around in a 3d world. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Aug 2003
Posts: 116
|
maybe I could suggest a few options for a challenge and if someone shows an interest in one I could go with that instead.
I know I was kinda thinking about one of several different topics for a challenge 1. 3d (as above) 2. paint splatter - some genuine kind of motion for paint splattering. a bit like a jackson pollock painting 3. a boat moving up and down in a gentle bobbing motion |
|
|
|
|
|
#5 |
|
Deprecated User?
|
There's nothing easy about 3D. The paint splatter challenge sounds intersting. I'd vote for that. Not sure I can do it, but I'll give it a shot sometime next week.
__________________
Check out my comic strip: With a Twist |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Aug 2003
Posts: 116
|
Ok - shall I post up a new challenge or just continue here ? I haven't got anything myself yet - but its a good idea
|
|
|
|
|
|
#7 |
|
six eyes
|
my 3d tutorial makes it fairly easy to understand (no matrix confusion included). Its lengthy though, and there arent too much in the ways of optimization - the examples listed so far all use 3 axis rotations in the script though only 2 are actually implemented.
... in the forums I have some examples altering the code so it wont calculate more than it needs to... but nevertheless, it works as it is there: http://www.kirupa.com/developer/acti...t/3d_index.htm just go from the top on down. But the paint splatter thing sounds fun too ![]()
__________________
(6) |
|
|
|
|
|
#8 |
|
Deprecated User?
|
@ senocular - Thanks, I'll check it out. I think on some level it comes down to understanding math, not AS. EDIT: I've never visited your site before. That's one heck of a resource you've got there. I think I'll be spending a lot of time browsing it. Thanks!!!
@ vulcanpimp - I suggest starting a new challenge. Who know's, maybe this will catch on. And you want to attract people to the new one who have already decided that this one wasn't for them. Fire away!
__________________
Check out my comic strip: With a Twist Last edited by dzy2566; 10-01-2003 at 02:49 PM.. |
|
|
|
|
|
#9 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
Just a quick reminder: when writing code blocks, please use the actionscript tags. You do this by in Selecting your code in the following tags:
[as ]somecode[ /as] (without the spaces)
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Aug 2003
Posts: 116
|
yeah great resource senocular
I know a lot of people get really put off by 3d cos many make it far too complicated than what it is. Though I still haven't quite got my head around the 3d translate. I know my example is not that good - but I was hoping to get some interest going on the topic of 3d. I've put a page up on my site. http://www.geocities.com/hairybobby2000/fx3ids.html the first example is the one I started off the thread with and the second is a little utility I wrote which actually created the vector shape. I was wondering if anyone else had such an idea. Because I've seen some similar ideas around but found them difficult to work. The utility lets you draw 3d vector shapes and then creates the code for them which it outputs to the message window in a trace command. I know the utility is a bit ropey but it works. I'll probably rework it later. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|