![]() |
Polehedra...
I'm trying to find an algorithm to model three dimensional regular to semiregular polyhedra using the Wythoff symbol . I've seen it done manually on Mathematica, but I use Maple and, well, Mathematica pales in comparison...
|
cant wait to see it!
|
I'm trying to find out what Maple does to do it, but that's kind of a stretch. I't going to be tough to actually fill the the faces and all...
|
filling faces is easy with triangle ape. for the trivial (triangle fan) way to draw any polygon just use two adjacent vertices for two of the triangle vertices, and the centre point of the polygon for the third (average of all vertices). breaks on concave polys tho... since there is no way to reverse get them from points...
|
I must admit, I never did triangle APE before...
I need a rundown, it sounds like a possibility. |
It's more or less like superscope, but instead of having just one point, you assign 3. So in a ssc we have (x,y) to define but with the triangle ape we have (x1,y1) (x2,y2) (x3,y3). If you can do a ssc, this isn't much different.
|
It's not that different from Superscope; you mainly just set x1, y1, x2, y2, x3, and y3, instead of just the one point (x and y) with the Superscope.
Also, to change the color, set "red1", "green1", and "blue1", instead of just "red", "green" and "blue". I think it's this way because there might (fat chance) be a later version which will let you use different colours for each point, and it will shade. (This would be cool, but probably too slow to be practical.) There is also a "zbuf" variable you can set to 1 to enable a simple form of Z-buffering. With this enabled, you can set the z1 variable to the distance to control the "Z-order" of the triangles. This is often quicker and easier than doing full depth-sorting for 3d scenes. Am I forgetting anything? |
/Points to the guide
|
Ok, does it draw just a triangle or fill it in?
|
it fills it in, that's the thrill to it!
|
Tres nice.
What about 3D? Or is Z-Buffering 3D...Bear with me... Hahaha...trivial (triangle fan)...Get it? tri Hahahaha! That's so funny! Hahahaha! |
There is a more efficient, and less trivial way. Which is to make a triangle fan from one vertex... it reduces the number of triangles by 1, but its not as easy to see how to implement, and looks ugly when subdivided/tesselated.
You can use 'z' to implement a flat z-buffer. i.e. one z value gets drawn per triangle. |
So it'd be tricky for polyhedra...
|
not really. its long winded to write, but you can prove that for any convex solid, back face culling is enough to correctly occlude the faces. its basically common sense, imagine holding out a polyhedron. the only faces you can see are the ones pointing within 90 degrees the opposite of your view direction, the ones you cant see are all facing away in the remaining 180 degrees.
you can do this test with a dot product and checking its sign... its in lots of presets, look at 'starfighter redux' in wfc2 i would recommend 'jet wash', but the code is in huge avstrans-ed blocks. in fact any of the model presets i have ever made probably contain it. you need to introduce 'occlusion' before z buffer is really necessary. e.g. convex objects that can have two triangles overlapping in 2d projection, both facing the viewer. or multiple objects, where one passes infront of the other. |
Ok, that's an idea, but still, I need to figure out how to get the Wythoff symbol or even the Schalffi symbol to yeild a polyhedron. Tough stuff...
|
Yeah, all this is well and good, but how do we figure out where to put the freakin' points in the first place!?
|
Exactly. I'm still thinking...
|
Forget those symbols and things... too elaborate.
Here are a couple of simple examples using a dodecahedron... I will add a couple more tomorrow, but I am tired right now. ftp://jheriko.kicks-ass.net:69/AVS/Jheriko/examples/ The platonic solids are all pretty easy to construct, and using some more geometry you can truncate them and stellate them into lots of other stuff. Also there are some other special cases that are interesting... check out these old packs of mine, feel free to steal the vertices: http://www.deviantart.com/deviation/720677/ http://www.deviantart.com/deviation/743266/ http://www.deviantart.com/deviation/911279/ |
Cool thanks. There is a bit of fun math that turns symbols into polydehra, but I don't quite get it...
I'm a junior in high school, you see... |
well.. the way the symbol works is by defining vertices on the inside of a sphere. but its not particularly useful unless you have a method of finding a convex hull... etc... its long winded. easier to work out a specific polyhedron that you want, and use it...
|
Well, I cound use the brute ofrce method, where it just screws around for a while, but that would be no good for a visualization. Besides, for simple coding, AVS syntax is just ugly.
|
You only need to generate a polyhedron once. Brute force it and stick it in the megabuf. Why make it so hard tho? Every specific polyhedron has a simple construction method.
|
not quite perfect, but i did the dm example. i can't be bothered to fix it right now... i can't work out why its broken... probably from looking at it for too long:
ftp://jheriko.kicks-ass.net:69/AVS/J...%20DM%203D.avs it gets the k correctly, but the texturing is messed up, and i had to make the camera face backwards in the dm for some reason... i will work it out later... |
| All times are GMT. The time now is 22:16. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.