Archive: Help For a newbie...


21st January 2002 03:11 UTC

Help For a newbie...
Hi all who lurk within this forum, I have a question which hopefully someone here may assist me with. I have already read the FAQ so I'm not being entirely sinful, but I don't know if this question has come up before. If it has I apologise and ask for forgiveness, and that the curses of breaking nettiquette do not rest upon me.

I'm new to this forum as you all know, but I have worked with AVS before and am not some Joe-average "How do I change the colour?" or "What the hell is AVS?" type. I'm quite versed in the workings of AVS (although I must confess that some of those mathematical statements e.g. on the superscope, or DDM can be a challenge).

Anyway, pleasantries aside...
I've only just realised that I seem to be missing
"Winamp 3DAPE v1". I realised this as Lone's "Distorted World" makes use of this Render APE. I have been, as yet unable to find this APE so I hope that someone here may point me in the right direction, and tell me of any other wicked APE's worth getting. I've even tried "BOX Project" but just don't know how to use it to design your own APE's. Also while I have you captivated by my words, are there any essential SVP/UVS loaders that I should know about?

Thanks in advance
Tonest@r
AVS is the best thing since stereo sound!


21st January 2002 03:28 UTC

The 3D ape is by Aarni Koskela, and it sucks. It just renders a monotone wireframe object, and rotates it one direction one speed. The wireframes aren't even that good, they're full of diagonals. Anyway, you can it up you want, but I'll post the APE and ASC files here. The pack this is from is called "Aarni Koskela's AVS Add Ons" or something like that and is in the AVS Presets section.
"needfile.zip" contains the objects Lone uses (cube.asc and sphere.asc) and the APE files (3d.ape and tv.ape).


21st January 2002 06:18 UTC

Thanks for that, and I do agree with you, those APE's could be better. The TV one is nothing special - I made a much better TV preset myself long before I saw that one. The wire objects are a little unimaginative, yes; however that sphere is just what I needed!

I have seen many presets called "Disco" but these are little more than Render Text flashing the word "DISCO" about the screen. I have been trying to create a preset which realisticly depicts a Disco Mirror Ball twirling around, and have so far tried Rendering with Movement or the DDM to create a sphere, - but as I'm not crash hot with the DDM I havent made a very good sphere at all. This wireframe one aught to help.

So I guess that's now a bit of an invitation for help seeing as I've contributed this idea. Anyone is welcome to show me their efforts - (giving me some credit though for coming up with the idea):)

Cheers
Tonestar Deluxe

AVS is the best thing since TV was broadcast in colour!


21st January 2002 14:53 UTC

I do
"Whacko AVS pack" (my first) has a 'floating in a 3D disco' preset. It's not as advanced as my newest 3D DM's, but it's *very* disco.
and "Whacko AVS III" has a floating 3D ball that looks sort-of like a dynamic discoball.
Just do a search for "Whacko" if you're interested.


21st January 2002 18:45 UTC

Hmm...for a disco ball, you'd want a globular wireframe sphere (instead of a normal spiral sphere, and I would NOT recommend the 3D ape), with the faces opaque and shaded. I don't know how UnConeD did the opaqueness in "Groovy Saturn," but I think it could be reprodced in a spiral. All you would have to do is find the size of a pixel in rect. coor. (1/w by 1/h), and find a way to twist the spiral so that it becomes opaque, no matter what screen size. The shading on that spiral might be hard, though. You would have to be able to find the angles of the faces in the sphere, then the angle of reflection from an imaginary light source. Then you could do your shading.
I don't think you'd have to do a DM for the disco lights (on the wall), you could probably use a fpg instead. Those actually are kind of hard (except for rotating starfields), but an fpg for simple disco lights (which goes one direction) could easily be figured out if you work at it. You would only need to generate positions for the X-coordinate, and then when that point reaches the side of the window, wrap it around and generate a random Y-coordinate. The speed of the particle's movement would be relative to the abs(x), i.e., the farther to the side the particle is, the faster it moves. If you wanted side walls, though, you could still generate those in the fpg. Just find where you want the walls to be, and when the particle hits the wall, move the Y-coordinate (again according to abs(y)). For source lights, those can easily be created by an opaque superscope like the spiral mentioned before, except this would be about 60 degrees. Then just shade the pixels according to how far away they are from the center. Or if you're too lazy, or you want it to look more realistic, you could just add a picture of disco lights. Of course, the lights on the wall would have to match the color of the lights on the cieling, as well as fade out as they went out of the range of the mirror ball's reflection. Now, for a disco floor, you might want a seperate effect list and a DM for that. That would be fairly easy, just render a couple of superscopes for the lighting, and then a movement to stretch them to the squares. Then use a DM to stretch and wrap those tiles. To do that, try this:
x=x/(abs(y)+0.005);
y=y/(abs(y)/20+0.005);
alpha=abs(y);
No infinity distortion, but the fog is a good thing to have because even without the distortion it's ugly. Anyway, you can't really make just one plane very easily, and you definitely can't do it without pixel repetition lines. So if you added yet another opaque black superscope where the walls are supposed to be, then put the effect list on "additive blend," that would simulate a disco floor.
Give ME credit for figuring it out :cool:
If you need any more tips for AVS, feel free to e-mail me at therealatero@hotmail.com - unless it's for 3D projections, or fpgs, which I'm still trying to work out myself. Otherwise, talk to UnConeD, he'll at least give you some starting pointers.

UnConeD, the search on the plugins section doesn't work (like, at all), so maybe you could post the URL to Whacko 3 here?


22nd January 2002 01:42 UTC

avs.acko.net
You can grab them from the AVS section on my site: avs.acko.net

But I would appreciate rating it here :)


22nd January 2002 07:09 UTC

Yep Atero, big credit goes to you :D
And there's certainly great mana upon you UnConed for your work.:up:
It has become quite clear through that discussion the difference in expertise between us members! I must confess that while you did explain to me and give me very good tips on how to go about this project, and I had an idea of what you were saying, it would still be very difficult for me to go and turn that advice into a preset just at the moment. (I guess that's why the wire frame sphere satisfied me - it's not bad for a 2minute preset ;) )
I suppose I'm not the only one here to admit to this, but I do confess that I just don't have those skills with the equations on the DDM/Superscope. I can do some basic stuff with them, but right now I just can't conceptualise something first, and then go out and produce it on a superscope - (and as a result I've sometimes had to compromise my work in some cases through lack of ability):hang: . However I can learn, just as I learned the other stuff; and I'm sure that even UnConed was once at the stage I'm now at (even if it was like years ago).
You know AVS has kinda been a consuming passion since I first discovered it myself - but I just wish I had come and joined you guys here way earlier! Well at least I have so I can learn off you guys (and Master Yoda).

Anyway, back to the preset which WE are creating.
Those ideas sound quite alright to me, Atero. I have already come across a preset which has the typical 'discofloor lighting' (found in "Tonic - Orbiblue (TS Party Under Stars Remix)" - it's available in one of the "Hopeless Worlds" packs). This uses (APE) FyrewurX, (Trans)Mosaic, Bump, and Movement [x = x/abs(y*1.03); y = y*3-2] to create the effect. It's worth seeing - search for it if you can. And (no offence UnConed) but I'd say I prefer this technique of discofloor lighting to the style you used in "Inside Rubik's Cube" (but that's not to say that your method's not cool - it is - I think I just prefer TS's take on it slightly more).

So anyway we'll see what that does to the equation.
In the meantime (whenever I can) I'll try not to let the side down and work on what I can.

Thanks guys for the help.
Here's to the group effort!:up:
Tonest@r

And as always, AVS is the best thing since the internet brought it on home!


23rd January 2002 04:19 UTC

Yeah, there are a LOT of people who are just sort of "Oh, this is cool, I think I'll throw some shit together and send it into Nullsoft." That group includes Tonic, as far as I'm concerned.
Anyway, here's the system for 3D superscopes to get you started off.
I got the original formula from El-Vis, but I've figured it out and this is a simplified version, so it's not completely cheating. To start with, think of a 3 dimensional room, with the walls being 1 and -1, left and right, bottom and top (this is an AVS screw-up, actually...unless someone can tell me any reasoning behind flipping the classic cartesian-coordinate map that's been used for hundreds of years), and back and front. Now, what happens in real life when things get farther away? They appear get smaller, but at a decreasing rate. So how to we simulate that effect? We divide X and Y by Z. BUT what happens at the center is division by zero which creates infinite distortion. So what we need to do is subtract 2 to Z before we divide by it. Now this is the formula we have:
x=x1/(z1-2);
y=y1/(z1-2);
So now we can start rotating shapes. Let's take a normal scope, with the coordinates:
x1=i*2-1;
y1=v/4;
z1=0;
To rotate an object around any axis, you take the other 2 coordinates and rotate them like this:
a=a*sin(t)-b*cos(t);
b=a*cos(t)+b*sin(t);
But we can't rotate the object, we have to rotate the entire room. So if we want to rotate on all 3 axes, we do this:
x1=i*2-1;
y1=v/4;
z1=0;
x2=x1*sin(zt)-y1*cos(zt);
y2=x1*cos(zt)+y1*sin(zt);
x3=x2*sin(yt);
z2=x2*cos(yt);
y3=y2*sin(xt)-z2*cos(xt);
z3=y2*cos(xt)+z2*sin(xt)-2;
x=x3/z3;
y=y3/z3;
Notice how I did not subtract 2 in z1, but instead in z3. This is because if I subtracted 2 from z1, it would, instead of moving the room farther away, so you didn't have infinity distortion, it would move the scope farther away in the room. And remember, you're rotating the ROOM, not the object itself. So you have to have it centered at 0, or else it swings around. Also, I got rid of the multiplication by z1, because z1=0. If you're running on a slow computer, small things like this make a difference.
By my conventions, zt, yt, and xt are all incremented by izt, iyt, and ixt (i stands for increment), which are all randomized per beat by:
rand(100)/200-0.25;
which gives 100 possible positive and negative levels of incrementation. But to each his own. Now, to move the room, you need to add the amount of movement to the axis3 variables. So if you wanted to move it one half a unit to the right, add 0.5 to x3.
A last simplification to this formula is making variables for the rotation sequence. Basically you take sin(t) and cos(t) and create variables for them in the frame block. So it all comes out like this:
init:
n=579;
beat:
izt=rand(100)/200-0.25; iyt=rand(100)/200-0.25; ixt=rand(100)/200-0.25;
frame:
zt=zt+izt; yt=yt+iyt; xt=xt+ixt; zs=sin(zt); zc=cos(zt); ys=sin(yt); yc=cos(yt); xs=sin(xt) xc=cos(xt);
pixel:
x1=i*2-1;
y1=v/4;
z1=0;
x2=x1*zs-y1*zc;
y2=x1*zc+y1*zs;
x3=x2*ys-z1*yc;
z2=x2*yc+z1*ys;
y3=y2*xs-z2*xc;
z3=y2*xc+z2*xs-2;
x=x3/z3;
y=y3/z3;
Now, if you REALLY needed a speed-up, you could combine all of the statements in the pixel block. This would take a while to get exactly right, so I'm not going to try it. But it should speed things up quite a bit if you did it.
UnConeD uses this system (as near as I can tell) in his 3D DM's, and I'm still trying to figure out why I can't do it as well...would the master care to explain to a mere mortal?

*downloads Whacko 3*
Hmm...
*turns off the fadeout in "Painful Bathroomtiles"* This is known as 'tripping out your ass'
This is awesome, 7 stars, as usual!

AND I STILL CAN'T FIGURE OUT WHY THE FLUP YOUR DM'S WORK!!!


23rd January 2002 12:00 UTC

It's your everyday ray-casting thingy :)
Take a line through the camera and the current grid point (x,y), slightly in front of the camera (you'll want a viewing angle of about 80°-90°). Intersect with a cylinder (Wormhole), sphere (Discoball) or collection of planes (Zero-G Maze).

Oh and for 3D-ish DM's you'll most likely want to recalculate x,y in function of d,r at the beginning, because else everything will look squashed at non-square sizes (compare Whacko AVS pack to Whacko AVS II and you should see a difference).


26th January 2002 08:43 UTC

I FIGURED IT OUT! You...umm...nevermind.
Hey...YEAH I DID! All you do is set up your initial position on the Z axis, rotate the un-changed plane, warp the plane in different directions, and you have a 3D projectional DM!

*looks at "Alien Chessboard"*
Wait a minute...you tricky little devil, that never worked for me! I tried that algorithm many times, and I always ended up with the Z values being proportioned wrong! Why does it work for you?

Hmm...I get your cube DM now, except for this line:
k=min(min(k1,k2),k3);
Up until that point I understood it, but here all I know is that k multiplied by the rotated plane gives you your set of 6 planes, which are on opposite sides of the x, y, and z axes, and that the render algorithm:
x=if(equal(k,k1),-ix,if(equal(k,k2),-iy,-ix));
y=if(equal(k,k1),iz,if(equal(k,k2),iz,iy));
is basically this:
x=if(equal(k,k1),iz,if(equal(k,k2),iy,ix));
y=if(equal(k,k1),ix,if(equal(k,k2),iz,iy));
smoothed out so that the edges match in a few places, and that you're matching 1/dy3 (k1) with iz and ix, which would create a plane on the y axis, and the same with 1/dx3 and 1/dz3. But WHY i(axis)*k gives you these coordinates escapes me.

I noticed in your tunneling DM you used a function not listed in the "expression help," atan2(a,b). What does this function do? And speaking of functions, would you happen to know what the sigmoid(a,b) function is about?


4th March 2003 23:14 UTC

Actually,Atero in the AVS primer you said 3D-2D translation was done like this:
x=x1/(z+2);
y=y1/(z+2);
even though it would work subtracting or adding 2 to z during translation.


4th March 2003 23:30 UTC

i still don't understand raytracing, but I'm still in geometry, i'm sure I will understand once I learn trig and calculus.


5th March 2003 00:02 UTC

hungryskull, please don't comment on something that you know nothing about. the 2 is the camera distance. Michael, you do not learn raytracing in either of those classes. It is an advanced topic that you may never learn in school(unless you take college computer science/programming courses).


5th March 2003 05:41 UTC

Went through a computer programming course, didn't learn anything like that. In comp eng at my college there's a game programming class where they touch on it, barely. Probably is different at other schools though.

Regardless, why was this 1 year 2 month old thread revived?


5th March 2003 08:39 UTC

Isnt raytracing also used in games ? I read an article some time ago and it mentioned that...


5th March 2003 12:15 UTC

It is used in games.


5th March 2003 12:34 UTC

Here is my own disco preset, not highly realistic but a realistic disco ball was done before and it would be boring to make another copycat preset.


5th March 2003 14:12 UTC

ggrr people bringing threads back from the dead. :)

No need for the atan2 explaination a year and bit after the request was posted. :)


5th March 2003 16:51 UTC

User your moderator powers Rova! Flex your mighty moderation muscles.


5th March 2003 19:01 UTC

:) Mod powers are like the force and should only be used for good. :)


6th March 2003 23:21 UTC

jesus christ...this thread was over a year old hungryskull. [size=huge]MAKE A NEW THREAD ABOUT IT.[/size]


7th March 2003 00:52 UTC

he's almost as bad as I am :)