wwwmwww Posted November 6, 2003 Share Posted November 6, 2003 (edited) Hey guys... Since joining the ranks of the unemployed I've taken the time to teach myself POV-Ray. After making my first wall paper and sharing it with Shawn he asked me "throw a light cycle up in the corner please :)" and I took that and ran with it. After not finding any accurate models of a light cycle on the web and not knowing how to get them into POV-Ray sort of helped... I created my own. Well... what do you guys think? Now for a mathematical question... I want to be able to put in an arbitrary angle of lean... lets call it theta. To keep things general my front tire is a sphere of radius r centered at x=0, y=r, z=0. Its surface looks like: ( x^2 + (y-r)^2 + z^2 ) = r^2 My back tire is a sphere compressed in just the z-direction by a factor that I'll call 'k'. Its centered at x=x0, y=r, z=0. And its surface looks like: (x-x0)^2 + (y-r)^2 + (z/k)^2 = r^2 Now what I plan to do is translate the bike so the front wheel is centered at the origin and rotate the bike by an angle theta about the x-axis. After this both wheels remain centered on the x-axis. Now if I just translate everything back up by r then the front wheel is still on the ground as its a sphere but the back wheel is up in the air. To fix that I want to rotate the bike about the z-axis by an angle phi till the lowest point on the rear tire is at y = -r before I translate the bike back up. So what I need is the best way to determine phi for a given theta. Can you help or point me in the right direction? The math is getting rather complicated and I've been out of school too long I think. Thanks for any help you can offer, Carl Edited November 7, 2003 by wwwmwww Quote Link to comment Share on other sites More sharing options...
GobotFool Posted November 6, 2003 Share Posted November 6, 2003 Nice!!!!! Love that translucent effect! Quote Link to comment Share on other sites More sharing options...
cube Posted November 6, 2003 Share Posted November 6, 2003 that's dope...you rock...i hate math Quote Link to comment Share on other sites More sharing options...
Shawn Posted November 6, 2003 Share Posted November 6, 2003 I don't know what language you are speaking Carl (( x^2 + (y-r)^2 + z^2 ) = r^2)?? but that cycle sure kicks ass Excellent job Now make a Focker and low-viz version of it...LOL The Cycle-1S S Quote Link to comment Share on other sites More sharing options...
Doktor Gonzo Posted November 6, 2003 Share Posted November 6, 2003 Well, this is a language that I speak a little of, I'll see if I can help - but I confess to being a little confused by your description. Can you please establish your coordinate system with x,y,z correlated to the major axes of the bike? thanks. Quote Link to comment Share on other sites More sharing options...
BoBe-Patt Posted November 6, 2003 Share Posted November 6, 2003 damn that's bad @$$!!! now, can you make a valk like that? Now that would be a nice project! Quote Link to comment Share on other sites More sharing options...
wwwmwww Posted November 7, 2003 Author Share Posted November 7, 2003 (edited) Well, this is a language that I speak a little of, I'll see if I can help - but I confess to being a little confused by your description. Can you please establish your coordinate system with x,y,z correlated to the major axes of the bike? thanks. Oh its a language I know too well and I think this is something I should be able to do but so far my attemps have failed me. Here is a picture that I believe should help. The origin is at the center of the front wheel and its also the center of both rotations... the first is about the x-axis by the angle theta and the second is by and angle phi about the z-axis. Think of the problem this way if its simplier... I want to roll the dumbell composed of the two attached ellipsoids into the screen. After I've roled the perfect sphere by an angle theta what angle does the bar attaching the two centers make with the floor? Here is how I started... the floor is at y=-r. After both rotations the center of the rear wheel is at y = x0*cos(phi). To simplify the problem translate the rear wheel to the origin and that makes the floor now at: y_floor = -r - x0*cos(phi) NOTE: x0 is negative The surface of interest is now just: x''^2 + y''^2 + (z''/k)^2 = r^2 And I've defined x'', y'', and z'' in the below pic. How do I solve this for the minimum y? I don't think there will be a nice closed form solution but I'd love to be proven wrong. After I have the minimum y value on the surface of this elipsoid all I have to do is find the phi that makes y_min = y_floor. Make sence? If not I hope these pictures will help... Thanks to anyone that helps. I'll offer a custom light cycle scene to the first that can give me a solution. You can specify the resolution... number and color of bikes... their orientation.. if they have tails... etc. I've got a nice scene rendering now that's only 50% done after 9 hours. I'll post it when its finished. Later, Carl Edited November 7, 2003 by wwwmwww Quote Link to comment Share on other sites More sharing options...
wwwmwww Posted November 8, 2003 Author Share Posted November 8, 2003 Now make a Focker and low-viz version of it...LOLS Does this qualify as a Max and Milia version? The render time for this one came to 1d 02h 40m 06s. And to be sure to give credit where credit is due. The wall in the background was made by maping the PNG images from the Armagetron Moviepack addon to a few boxes and sticking them together. You can get them here: http://armagetron.sourceforge.net/addons/moviepack.zip Everything else is my creation. At some point in time I might redo the wall with real floating 3D cutouts but for now I thought is was a good quick way to make a wall. I always welcome feedback and I may even try to honor a few requests... Enjoy everyone... Carl Quote Link to comment Share on other sites More sharing options...
wwwmwww Posted November 12, 2003 Author Share Posted November 12, 2003 I'm about to take off for an interview I have tomorrow. Wish me luck everyone. Maybe by the time I get back I'll have another render to share with y'all. Later, Carl Quote Link to comment Share on other sites More sharing options...
Winkle Posted November 12, 2003 Share Posted November 12, 2003 All I can say is... SWEEEEEEEEET. Quote Link to comment Share on other sites More sharing options...
wwwmwww Posted November 14, 2003 Author Share Posted November 14, 2003 (edited) I'm back... interview went well I believe. I learned I was the first to be interviewed for the position and that they have plans to interview one or two others. They said they hope to make up their minds in two to four weeks. So needless to say I'm still sitting on pins and needles. I wish I had something better to say but atleast its not bad news either. Oh... and I believe I've now got a solution to my math problem. For those of you interested (if that's anyone) here is what I have at the moment. I still need to sit down with pencil and paper (alot of paper) and check this all out and find a way to code it... but I believe this is correct. First of all start by referencing this page: http://mathworld.wolfram.com/OblateSpheroid.html From there I went to Dr. Math and they sent me the following... Hi again, Carl. After thinking about your problem I decided to consult a colleague, who was able to provide some useful comments. To help clarify things I restated the problem as below. Whether or not these changes actually simplify the problem is open to debate, but I hope you are able to follow the reasoning: 1. Consider the oblate spheroid S that is the rear wheel. In order to have it rest on the ground, we must find the point Q on the spheroid at which a tangent plane intersects it. This set of tangent planes is parametrized by their height--we drop the wheel down onto the ground until it touches at one point Q(x,y,z). 2. To make use of this picture, we need to find the point Q as a function of lean angle. To make the math simpler, it is helpful to put the oblate spheroid S centered at the origin (although tilted with respect to the coordinate axes). This is a very helpful simplification. 3. Define the coordinate system as follows: Let {x,y,z} is a right handed coordinate system with z pointing up (that is, perpendicular to the ground). Define the angle of lean as theta = (pi/2 - v*), where v* is according to Eqs. (1)-(3) in the notation of the Mathworld [MW] site. That is, v*=0 corresponds to a tire that has fallen over on its side, and v*=80 degrees means that the tire is leaning by 10 degrees from upright [we will want to find the location of Q for a lean of approximately this size] Now, one question is what is the actual tilt value that we should use for a given theta. For small leans theta, we can let v = pi/2 - theta, and call it the "first-order" calculation. But for the general case, we will use the arbitrarily rotated ellipse [from Eqn (62), MW]. I think that the angle B* is v, and angle P* is chosen by rotating the bike frame about the center of S, so that the front wheel touches the ground at the same height as the bottommost point of S. This keeps the ground planes horizontal in the coordinate system (again, this is extremely helpful in keeping things tractable). Thus, at this point we have the equation of the rotated spheroid S: Ax^2 + By^2 + Cz^2 + Dxy + Exz + Fyz = 1 [62,MW] with coefficients given in terms of angles B* and P*, and the semimajor and semiminor axes lengths of S [Eqn's (63)-(68), MW]. Now, we want to find the horizontal plane z = z0 which intersects the bottommost point of this spheroid. How do we calculate this? The key is to realize that any plane that slices through S gives an ellipse. If this ellipse degenerates to a single point, we have found a tangent plane. For a horizontal plane at z = z0, we have Ax^2 + Dxy + By^2 + (E.z0)x + (F.z0)y = 1 - Cz0^2 This equation describes the intersection between S and the plane z=z0. A change of variables (FD - 2*BE) x = -----------z0 + X (4AB - D^2) (DE - 2*AF) y = -----------z0 + Y (4AB - D^2) leads to (if I didn't make a mistake): AX^2 + DXY + BY^2 = 1 - [C + (EDF - BE - AF)/(4AB - D^2)]z0^2 Now, if the right hand side is positive, we get an ellipse. If it is negative, there is no solution and the plane z=z0 does not even intersect S. And if the right hand side vanishes (yay!), we get an expression for the value of z0, in terms of the numbers A,B,C,D,E,F: z0 = sqrt(1/ [*]). where [*] represents the bracketed expression in the previous equation. Whew!! Now you're done: you have the twice-rotated oblate spheroid (rotations by B* and P*) centered at the origin (x=0,y=0,z=0), resting on a ground plane at z=-|z0| at the contact point Q(X=0,Y=0). Note that you'll have to shift coordinates back to find Q in terms of x and y. The rotation angle P* tells you how much to elevate the front wheel so that it too rests on the ground plane. Thanks for submitting such a fun problem. - Doctor Douglas, The Math Forum Edited November 14, 2003 by wwwmwww Quote Link to comment Share on other sites More sharing options...
CoryHolmes Posted November 15, 2003 Share Posted November 15, 2003 Oh, ow. Numbers, evil numbers. GREAT results, though. I love the translucent effects. How long until we get a full-on vid clip of this stuff? Quote Link to comment Share on other sites More sharing options...
Commander McBride Posted November 15, 2003 Share Posted November 15, 2003 I don't think there has ever been a thread that confused me more thatn this one..... Quote Link to comment Share on other sites More sharing options...
EXO Posted November 15, 2003 Share Posted November 15, 2003 Ax^2 + Dxy + By^2 + (E.z0)x + (F.z0)y = 1 - Cz0^2This equation describes the intersection between S and the plane z=z0. A change of variables (FD - 2*BE) x = -----------z0 + X (4AB - D^2) (DE - 2*AF) y = -----------z0 + Y (4AB - D^2) leads to (if I didn't make a mistake): AX^2 + DXY + BY^2 = 1 - [C + (EDF - BE - AF)/(4AB - D^2)]z0^2 Damn you Dr. Douglas!!! you beat me to it!!! Quote Link to comment Share on other sites More sharing options...
GobotFool Posted November 16, 2003 Share Posted November 16, 2003 Seeing these beuties it makes me wish the lightcyles in tron 2.0 didn't suck so badly. Though the rest of the game was pretty good Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.