Skip to content
Forum Archive

LOTR fans!

50 posts

Zevensoft#
Here's a LotR-related superscope, you may be able to use it somewhere else...

Init

pi=acos(-1);orxs=pi/70;orys=pi/60;orxs=pi/50;n=4000;dst=tan(120*(pi/180)/2);
Frame

orx=orx+orxs;ory=ory+orys;orz=orz+orzs;lz=0;lx=1;ly=0;
Point (The big one)

z1=sin(i*pi*n/8)/10;
y1=0*cos(i*pi*2)+(cos(i*pi*n/8)/10+.9)*sin(i*pi*2);
x1=(cos(i*pi*n/8)/10+.9)*cos(i*pi*2)-0*sin(i*pi*2);
z3=sin((i+1/n/8)*pi*n/8)/10;
y3=0*cos(i*pi*2)+(cos((i+1/n/8)*pi*n/8)/10+.9)*sin(i*pi*2);
x3=(cos((i+1/n/8)*pi*n/8)/10+.9)*cos(i*pi*2)-0*sin(i*pi*2);
z2=sin(i*pi*n/8)/10;
y2=0*cos((i+1/n*2)*pi*2)+(cos(i*pi*n/8)/10+.9)*sin((i+1/n*2)*pi*2);
x2=(cos(i*pi*n/8)/10+.9)*cos((i+1/n*2)*pi*2)-0*sin((i+1/n*2)*pi*2);
tx=x1*cos(orz)-y1*sin(orz);ty=y1*cos(orz)+x1*sin(orz);x=tx*cos(ory)-z1*sin(ory);
tz=z1*cos(ory)+tx*sin(ory);z=tz*cos(orx)-ty*sin(orx);y=ty*cos(orx)+tz*sin(orx);
tx=x2*cos(orz)-y2*sin(orz);ty=y2*cos(orz)+x2*sin(orz);x2=tx*cos(ory)-z2*sin(ory);
tz=z2*cos(ory)+tx*sin(ory);z2=tz*cos(orx)-ty*sin(orx);y2=ty*cos(orx)+tz*sin(orx);
tx=x3*cos(orz)-y3*sin(orz);ty=y3*cos(orz)+x3*sin(orz);x3=tx*cos(ory)-z3*sin(ory);
tz=z3*cos(ory)+tx*sin(ory);z3=tz*cos(orx)-ty*sin(orx);y3=ty*cos(orx)+tz*sin(orx);
x1=x;y1=y;z1=z;
x=x/(z+dst);y=y/(z+dst);
x4=x1-x2;x5=x1-x3;
y4=y1-y2;y5=y1-y3;
z4=z1-z2;z5=z1-z3;
nx=y4*z5-z4*y5;ny=z4*x5-x4*z5;nz=x4*y5-y4*x5;
dd=sqrt(nx*nx+ny*ny+nz*nz);nx=nx/dd;ny=ny/dd;nz=nz/dd;
ldx=x1-lx;ldy=y1-ly;ldz=z1-lz;
dd=sqrt(ldx*ldx+ldy*ldy+ldz*ldz);ldx=ldx/dd;ldy=ldy/dd;ldz=ldz/dd;
li=(nx*ldx+ny*ldy+nz*ldz);li=if(above(li,0),li,0);
br=if(above(z+dst,.5),1-((z)/(3-.5)),0);
red=br*li;
green=br*li;
blue=br*li;
The only variables you need to know, are the (lx,ly,lz) ones, these define the light position, and the higher the n, the better the look, the slower it runs...

And in case you were wondering, what the superscope does is calculate 3 points of a torus at once, and rotates them in 3D, then calculate the normals of the 3 points (making a face) by calculating the cross product, then takes a normalized value, and subtracts the point's position by the light value, then normalizes that, then uses the dot product of both normalized vectors to calculate the light intensity.

And if you have found a way of making it better, please let me know 🙂 (Although not many people may even know what a normal is...)
Zevensoft#
That version above is flat-shaded. The new version below is faster and (if winamp supported smooth-shaded lines) gouraud-shade (compatible, ie. by vertex).

All you gotta change is the point code:

z1=sin(i*pi*n/8)/10;
y1=0*cos(i*pi*2)+(cos(i*pi*n/8)/10+.9)*sin(i*pi*2);
x1=(cos(i*pi*n/8)/10+.9)*cos(i*pi*2)-0*sin(i*pi*2);
tx=x1*cos(orz)-y1*sin(orz);ty=y1*cos(orz)+x1*sin(orz);x=tx*cos(ory)-z1*sin(ory);
tz=z1*cos(ory)+tx*sin(ory);z=tz*cos(orx)-ty*sin(orx);y=ty*cos(orx)+tz*sin(orx);
nz=sin(i*pi*n/8);
ny=0*cos(i*pi*2)+(cos(i*pi*n/8))*sin(i*pi*2);
nx=(cos(i*pi*n/8))*cos(i*pi*2)-0*sin(i*pi*2);
tx=nx*cos(orz)-ny*sin(orz);ty=ny*cos(orz)+nx*sin(orz);nx=tx*cos(ory)-nz*sin(ory);
tz=nz*cos(ory)+tx*sin(ory);nz=tz*cos(orx)-ty*sin(orx);ny=ty*cos(orx)+tz*sin(orx);
x1=x;y1=y;z1=z;
x=x/(z+dst);y=y/(z+dst);
ldx=x1-lx;ldy=y1-ly;ldz=z1-lz;
dd=sqrt(ldx*ldx+ldy*ldy+ldz*ldz);ldx=ldx/dd;ldy=ldy/dd;ldz=ldz/dd;
li=(nx*ldx+ny*ldy+nz*ldz);li=if(above(li,0),li,0);
br=if(above(z+dst,.5),1-((z)/(3-.5)),0);
red=br*li;
green=br*li;
blue=br*li;
Also, the math-luvvin' out there will realise there's no need to normalize the face normal, as it's generated based on a unit sphere.
UnConeD#
Gradient

I'm not sure what you meant with the unit-sphere, but wouldn't it be easier to calculate the normal in a point as the gradient of the torus' equation?

For a torus with radii c (from center to the tube's center) and a (radius of the tube) the equation is:

sqr(c - sqrt(sqr(x)+sqr(y))) + sqr(z) = sqr(a)


So the gradient's components are:



By calculating the 3 components and normalizing the resulting vector, you get the normal on the function's isosurface through that point (which is of course your torus).

As you can see, the x and y components are nearly the same, so you can optimize them easily.

Oh and if you calculate the sines and cosines of your rotation matrix only once instead of each frame, it'll speed up more.
Jaheckelsafar#
Um, yeah. Quick, before my brain explodes.

Yes, that's what I meant. You can stretch it by mulyiplying x1,y1,z1 to give it more of a crossguard look.
Zevensoft#
Unconed, the unit sphere method is faster because it just uses the fact that the face normal at any point on a sphere is the negative of the vector of the point. So basically, I'm using a sphere's normals and using them for the torus. It looks good, and runs good. I also used that hint about the pre-defined sin and cos, thanks for that.
UnConeD#
Hmmm you mean you're calculating the normal as if the torus was a round string of spheres, not that it's enclosed in a sphere, right?
Guest#
sorry those colored bmp files are big 😠
here is a smaler pack:
cmountford#
jpeg

Just use a jpeg. I'll just convert it back to a .bmp

I'm almost ready to post some modifications (hopefully improvements) 🙂
Guest#
ok, first the original picture:

and this is the AVS version:
Zevensoft#
Here's a new version, I managed to improve the look, and added a shadow+bouncing effect.

Maybe next I'll add specular highlights.
cmountford#
Okay-here's some Bryce pics

I'm currently using a demo of Bryce, so one of the pictures will have the demo MetaTools background embedded in it.

Maybe some of you smart people could make a DM to zoom in on Barad Dur then rise up to the top (like in the movie one of the times when Frodo puts the ring on & he sees Barad Dur in the distance...then it keeps getting closer & closer. When it seems that he's reached it, the image moves up to the top of the tower where he sees the eye-you know...that scene I just described). That *would* be extremely cool

If I had a full version of Bryce5, I'm sure they would be much better.
cmountford#
more help

This is great coding work for the ring, guys! Thanks a lot...I just wish I could do stuff like that so I could put it in one of my upcoming packs. Jaheckelsafar: The handle of the sword is really stumping me. And the sword is still a little messed up. I'm trying to get it to look just a little more like a sword (handle shape, etc.) but am still having problems figuring out what to do.

Please help! Also, maybe some of you people who are good with coding can come up with a DM to get the desired effect I mentioned in a reply I made earlier...zooming in, then going to top of Barad Dur.

Thanks a lot.

The LOTR Thread lives on!!! 😁
SSGX#
My Eye

Hello everyone!

Heh...this is my very first post on the Winamp forums...

In fact, this thread was what made me register...lol

While reading it, I decided to create my own version of The Eye of Sauron... And I think it turned out pretty well...so I just had to register to show it off...lol Perhaps this'll end up being the beginning of a productive stay here... Who knows...lol

It even uses a slight variation of the superscope code given by UnConeD in this very thread for the pupil... But there's a comment included that says a bit more about it...

A couple of notes about myself, though... This preset is only the 5th that I've created... None of the others are "released"...they all remain for my own private use... And so far, they're all pretty basic... But they're just what I want... Simple and highly reactive... I'm sure I'll share them someday soon...

And without further ado... The Eye of Sauron!
Jaheckelsafar#
Umm... gimme a week or two. Just got my laptop back and had to restore the harddrive cause explorer kept crashing. Only in town for the weekends and all that... I'll modify work from the original anyshape code though, 'cause I'm not sure how any changes will affect yours.
Jaheckelsafar#
Hey, whipped this thing up. It might not be quite what you're looking for, and could be made faster without the point setup I used because the shapes are significantly simpler. You could probably make it look more like a sword too.

Anyhoo, here it is.
Xion(810)#
I think El-Vis made a realistic-looking eye of Sauron...Look.
jheriko#
you can create the zooming in then going up then stopping effect using dynamic movement quite easily if you already know how to make a zooming in and a going up on their own by using the if statement... you simply need to make a timer that increments and use if functions to make it do the zoom code for the first, say 3 seconds ish then do the going up then do nothing... i wont tell you exactly how to do it cos i guess that will take some of the fun out of it but id say that would be the best way to do it, how you'dd create the tower and everything? i dunno, the problem with zooming in with dm is everything will go blocky unless you start zoomed out, which means tiling so you'll lose the rest of the image... i don't think dm is actually the answer to that one now that i think about it more...

you'dd probably want to make the tower from a 3d ssc then make that move towards you then down using the if statement, you could then use dm to fade the eye in...
jheriko#
sorry i forgot to include this in the last post but if you go and download my 3rd pack from here (its not very big) it contains a lotr based preset of a spinning ring(solid ring using one superscope with hashed lighting effect on it) with the eye flashing up onbeat, i ended up simplifying the eye a great deal so that it looked alright without needing to render for too many frames so its not very good to base an eye preset on but if that ring were modified an optimised it only uses one superscope and looks nicer.. a cool thing would be to put the writing around the ring 🙂
fholborn#
OK, try this Lord of the Rings Flaming Eye!

Hey all, got some serious flames going here wrapped onto 2 of C.Mountford's excellent render-shape inputs. Is that about it?

Enjoy!

/Fred