Thanx 🙂
I think that the fastest way to calculate something using eather of thease two methods would be to find a limes for n->5 or 6.
Now when I look at the 2nd version of the torus its clear that i made a mistake somewhere moast probably at seperating the equation by k.
Btw. I didnt make the hyperboloid yet, im having problems whith maping and blending.
Torus
56 posts
One preset to rule them all 🙂
The ring is a DM with diffuse lighting (light source moves around), with the ring text blended onto it by a secondary (simpler DM). The text contains ugly edges because I spread it around over the whole screen (higher resolution).
Proof of concept of course, it's not very watchable.
I made the bmp by copy/pasting this image and changing it a bit in PSP.
Nixa: hyperboloids are very easy actually... just invert one square in the formula for a circle:
x^2 + y^2 + z^2 = 1 (circle)
x^2 - y^2 + z^2 = 1 (hyperboloid w/ circles in the xz plane)
The ring is a DM with diffuse lighting (light source moves around), with the ring text blended onto it by a secondary (simpler DM). The text contains ugly edges because I spread it around over the whole screen (higher resolution).
Proof of concept of course, it's not very watchable.
I made the bmp by copy/pasting this image and changing it a bit in PSP.
Nixa: hyperboloids are very easy actually... just invert one square in the formula for a circle:
x^2 + y^2 + z^2 = 1 (circle)
x^2 - y^2 + z^2 = 1 (hyperboloid w/ circles in the xz plane)
Btw Atero (doubleposting because it's a different subject), the function f is exactly the function you're working with.
Newton-raphson and the secant formula are used to find approximations of X where f(X) = 0. Given an approximation Xn, you get Xn+1, a better approximation.
They both converge pretty quickly. For example if you apply it to the equation x^2 - 2 = 0, it allows you to find an approximation of sqrt(2), because we know f(sqrt(2)) = 0.
Xn+1 = 0.5 * (Xn + 2/Xn)
For example if you start out with 2, you get:
2, 1.5, 1.41666.., 1.414215..
As you can see it can give you quick results with only a couple of iterations. This method was known by the greek to calculate square roots I think.
Newton-raphson and the secant formula are used to find approximations of X where f(X) = 0. Given an approximation Xn, you get Xn+1, a better approximation.
They both converge pretty quickly. For example if you apply it to the equation x^2 - 2 = 0, it allows you to find an approximation of sqrt(2), because we know f(sqrt(2)) = 0.
Xn+1 = 0.5 * (Xn + 2/Xn)
For example if you start out with 2, you get:
2, 1.5, 1.41666.., 1.414215..
As you can see it can give you quick results with only a couple of iterations. This method was known by the greek to calculate square roots I think.
I like the ring unconed, except for the ugly edges. I personally think it should be thicker though.
wow, amazing, apart from the edges.
the code scares me
the code scares me
Here's an updated version... light position is now rotation dependent (gives it a nice shimmering effect) and the outer edge is slightly blurred. The inner edge's still ugly though.
I think this would be fun for projections, because with all the tolkien hype going on , people should recognize it 😉 (*hint* *hint*).
For fun, set gridsize in DM1 to 128x128 and watch the purty ring 🙂.
(PS: Updated this attachment twice, so redownload if you downloaded it before).
I think this would be fun for projections, because with all the tolkien hype going on , people should recognize it 😉 (*hint* *hint*).
For fun, set gridsize in DM1 to 128x128 and watch the purty ring 🙂.
(PS: Updated this attachment twice, so redownload if you downloaded it before).
There are some glitchy lines on the outside.🙁 Besides that it is nice. Looks much more like a ring now that it is a bit thicker.
Another idea I've had for raytracing bizarre/complex shapes would be to workout the sphere of curvature at the point being raytraced and then use it to approximate the surface at that point... if anyone could be fagged to put that into code then it would probably work quite well.
BTW UCD... both off your lotrs crash my AVS 🙁
BTW UCD... both off your lotrs crash my AVS 🙁
Mine too. Usu. when I'm switching screensizes, and have a very high gridsize on the first DM (the same as the second I expect, though I haven't checked)
BTW, the text DM causes those glitchy lines as it's of a lower gridsize, but it's only noticeable when you slow it down.
BTW, the text DM causes those glitchy lines as it's of a lower gridsize, but it's only noticeable when you slow it down.
Mine just crashes on load...
Are you using winamp 3? It chrashed winaamp 2 for me, but 3 works fine.
Both worked for me on Winamp2... In the first one, for some reason the writings on the ring is out of sync very often... (Usually in the beginning sequence - If it's outta sync, it will be like that all the time)
It worked for me in Winamp2 and 3, but I don't have the picture 2 ape, so the problem could be with it.
Works fine for me. Great work(now i see what you ment when talking about 2nd additive blended DM).
Can someone tell me what is the way to go from 3D cartesian to 3D polars? Im wondering would it be posible to define 3D objects using them. For example torus would be made just by raytracing a plane, going from cartesian to polar coordinares and using that formula Jheriko posted in main avs forum whith v=r1 and u=r2.
I attached my hyperboloid. I checked everything 3 times and it still looks weerd.
Btw. for anyone who is intereseted in making 3D DMs you can find some really cool and weerd looking surfaces at mathworld.wolfram.com
Can someone tell me what is the way to go from 3D cartesian to 3D polars? Im wondering would it be posible to define 3D objects using them. For example torus would be made just by raytracing a plane, going from cartesian to polar coordinares and using that formula Jheriko posted in main avs forum whith v=r1 and u=r2.
I attached my hyperboloid. I checked everything 3 times and it still looks weerd.
Btw. for anyone who is intereseted in making 3D DMs you can find some really cool and weerd looking surfaces at mathworld.wolfram.com
An algebraic surface with affine equation P_d(x_1,x_2)+T_d(x_3)=0, (1) where T_d(x) is a Chebyshev polynomial of the first kind and P_d(x_1,x_2) is a polynomial defined by (2) where the matrices have dimensions d×d. These represent surfaces in CP^3 with only ordinary double points as singularities. The first few surfaces are given by x+y+z=0 (3) x^2+y^2+2z^2=1+2x+2y (4) 6+x^3+y^3+4z^3=3(2xy+z). (5) The dth order such surface has N(d)={1/(12)(5d^3-13d^2+12d) if d=0 (mod...
Imagine making something like this in avs 🙂
I posted a conversion fro 3d polars <-> 3d cartesian before... you can find it here:
Hope that you find it useful.
Another thing that I forgot to mention before is about hyperboloids... I've experimented with them as DMs but haven't really had any really decent results (i.e. I think they look ugly). There are two types of hyperboloid, the hyperboloid of one sheet and the hyperboloid of two sheets.
x^2/a^2-y^2/b^2+z^2/c^2=1 <-- one sheet
x^2/a^2-y^2/b^2-z^2/c^2=1 <-- two sheets
The difference is that one is a connected surface and the other is not.
A space to talk about everything related to Winamp Advanced Visualization Studio. Look at the pretty lights.... If you have any troubleshooting questions, bugs, or feature requests, submit them to the AVS <b>SUB-Forums</b> instead of this one!
Hope that you find it useful.
Another thing that I forgot to mention before is about hyperboloids... I've experimented with them as DMs but haven't really had any really decent results (i.e. I think they look ugly). There are two types of hyperboloid, the hyperboloid of one sheet and the hyperboloid of two sheets.
x^2/a^2-y^2/b^2+z^2/c^2=1 <-- one sheet
x^2/a^2-y^2/b^2-z^2/c^2=1 <-- two sheets
The difference is that one is a connected surface and the other is not.
I think x^2/a^2-y^2/b^2+z^2/c^2=1 is one sheat and x^2/a^2-y^2/b^2+z^2/c^2=-1 two sheats if the hyperboloid is rotated around y=0.
Unconed could you write some explenation on how to light 3D objects. I dont know how to calculate normals(I dont even know what normals are) but would like to have some moving colored lights in another preset im working on(unfinished version is attached).
A normal is a vector that is perpendicular to the surface.
For example the normal to an inclined plane will be perpendicular to the plane. Don't know much about lighting though.
For example the normal to an inclined plane will be perpendicular to the plane. Don't know much about lighting though.
You need the normals to know how the light will act... after all light is reflected off of an object and you need normals for reflection. Working out normals is often done most easily by finding a tangent plane and cross producting any two linearly independant (i.e. perpendicular) vectors contained in it. There are a multitude of methods though, and what is easiest in maths is not often easiest in AVS.
NOTE: If we denote the cross product by '^' then:
a^b=|a||b|sin(theta) n
Where n is a unit normal vector to a and b (|n|=1) and theta is the angle between a and b. If you just want to find any normal though, the cross product will do.
NOTE: If we denote the cross product by '^' then:
a^b=|a||b|sin(theta) n
Where n is a unit normal vector to a and b (|n|=1) and theta is the angle between a and b. If you just want to find any normal though, the cross product will do.
Oh dearie me! Using the absolute value function...tsk tsk tsk. And you call yourself a mathematitican. You ought to be ashamed of yourself. 😔
😉
😉
Actually Atero, in jheriko's formula, a and b are vectors, so |a| and |b| mean the vector's norm (length).
What's wrong with using absolute value anyway?
Oh and if you want easy normals, there are a few ways to fake them.
For a sphere, the normal at point (x,y,z) is simply the vector (x,y,z) normalised (length = 1).
For an ellipsoid this doesn't work anymore, but you can approximate this if you tinker with it:
for example an ellipsoid with x^2 + y^2 + (z^2)*4 = 0 (sphere that is squished on the z-axis), the normal corresponds roughly with (x,y,2*z).
For example for my lotr preset, I approximated the normal on a hyperbola by flipping the shared components with the sphere
sphere: x^2 + y^2 + z^2 = 1
hyperb: x^2 + y^2 - z^2 = 1
sphere normal: (x,y,z)
hyperb normal: (-x,-y,z)
(the hyperb's side is on the inside... if you're looking at the outside, you should use (x,y,-z))
The approximated normal should of course point somewhat in the right direction, but this is not that important. What's more important is how the normal changes. The way the normal changes defines the curvature of the surface, and if the approxiated curvature is wrong your surface will look wrong too.
What's wrong with using absolute value anyway?
Oh and if you want easy normals, there are a few ways to fake them.
For a sphere, the normal at point (x,y,z) is simply the vector (x,y,z) normalised (length = 1).
For an ellipsoid this doesn't work anymore, but you can approximate this if you tinker with it:
for example an ellipsoid with x^2 + y^2 + (z^2)*4 = 0 (sphere that is squished on the z-axis), the normal corresponds roughly with (x,y,2*z).
For example for my lotr preset, I approximated the normal on a hyperbola by flipping the shared components with the sphere
sphere: x^2 + y^2 + z^2 = 1
hyperb: x^2 + y^2 - z^2 = 1
sphere normal: (x,y,z)
hyperb normal: (-x,-y,z)
(the hyperb's side is on the inside... if you're looking at the outside, you should use (x,y,-z))
The approximated normal should of course point somewhat in the right direction, but this is not that important. What's more important is how the normal changes. The way the normal changes defines the curvature of the surface, and if the approxiated curvature is wrong your surface will look wrong too.
Dag nabbit, and here I thought he was (again) being hypocritical 😛
Remember he was bitching at me for using the absolute value function here:
|x/a|^n+|y/b|^n=1
so that it would be a closed and continuous curve for any n - fixing more problems then y=|x| even proposes?
Remember he was bitching at me for using the absolute value function here:
|x/a|^n+|y/b|^n=1
so that it would be a closed and continuous curve for any n - fixing more problems then y=|x| even proposes?
By the way, here's a simple curvy shape with normals. The 'hair' on it is an approximated normal at that point.
Basically the blob is a distorted sphere, so if a point on the sphere can be described by its two angles (phi, theta), I calculate the crossproduct between the vectors described by
[(phi+d(phi),theta)-(phi,theta)] X [(phi,theta+d(theta))-(phi,theta)]
Where d(phi) and d(theta) mean some small offset (e.g. .1 radians) along that axis.
This works for any surface that is parametrised in two variables. For a sphere (two angles) or a grid (two cartesian coordinates).
Check the attached scope and picture.
Basically the blob is a distorted sphere, so if a point on the sphere can be described by its two angles (phi, theta), I calculate the crossproduct between the vectors described by
[(phi+d(phi),theta)-(phi,theta)] X [(phi,theta+d(theta))-(phi,theta)]
Where d(phi) and d(theta) mean some small offset (e.g. .1 radians) along that axis.
This works for any surface that is parametrised in two variables. For a sphere (two angles) or a grid (two cartesian coordinates).
Check the attached scope and picture.
Here's an example scope: shape with normals.
Unconed, that blob with normals is almost good enough to be a pack-worthy preset. Very nice. I would say that if you through a nice alien background on it, then you could have a great preset.