- AVS Presets
- my 3D engine for super scope
Archive: my 3D engine for super scope
C.G.
26th May 2003 12:20 UTC
my 3D engine for super scope
yesterday I said to make my own 3d engine for Super scope and here is what i managed to make.
u will see the whole matrix thing in the per point field... but i make all the calculations for the elements in per frame basis. after that is a normal projection formula and the last 3 lines are for the colors.
I have also included a comment node where i explain all the variables i use.
btw before the matrix is the algorithm for the 3d sphere. It is the same with the previous 3d i made with ELVIS engine. for those who wonder... i use a cubic interpolation for the spacing of the point in the z axis. I am sure there should be a more optimised way to do it.
Tuggummi
26th May 2003 13:28 UTC
An ok sphere, done before a million times, but you can still build a pretty good preset from it. I would suggest that you use more lines and make it sound reactive, also a onbeat-randomized spinning is definetly needed.
As for the engine, i really couldn't care less :p I only "judge" presets by their looks (atleast i like to think so...) But the codefreaks here sure will be pleased for your effort :D
Zevensoft
26th May 2003 14:13 UTC
Nice, I see potential in you. If you want, you should have a look at some of my 3D code.
C.G.
26th May 2003 14:31 UTC
Tuggummi the thing is i post that thread not for the visual result but for the code... i mean the sphere was just a sample to see that the engine works!
ok Zevensoft i'll have a look...
Tuggummi
26th May 2003 14:42 UTC
Well, even if it's an example, i think it would make a nice preset, that's all :)
Raz
26th May 2003 20:33 UTC
The quickest form of 3d rotation i ever came up with was this:
Beat:
gx1=getosc(0.5,0,1)*0.1; gy1=getosc(1,0.5,0)*0.1; gz1=getosc(0,1,0.5)*0.1;
Frame:
ax=ax+gx1; ay=ay+gy1; az=az+gz1;xxx=cos(ax); xax=sin(ax); zzz=sin(az);zaz=cos(az); yyy=sin(ay); yay=cos(ay);
Point:
x1=...
y1=...
z1=...
x=(x1*zzz+y1*zaz)*yyy+z1*yay;
y=(x1*zaz-y1*zzz)*xax+((x1*zzz+y1*zaz)*yay-z1*yyy)*xxx;
The only reason i don't still use it is because i couldn't be bothered figuring out what the equivalent of "z3" was to do depth colouring. It probably has problems, i can't be bothered checking because i don't use it anymore.
dirkdeftly
27th May 2003 01:35 UTC
cg: 3d engines are all over the place, there wasn't any real need to post this.
raz: how many times do i have to tell you...DON'T use straight up getspec for random seeding!
(getspec(...)*bignumber%returns)/(returns/range/2)-range/2;
is equivalent to:
rand(returns)/(returns/range/2)-range/2;
and returns "returns" numbers in the range of -range/2..range/2
sidd
27th May 2003 01:54 UTC
Nice, I see potential in you.
So who the fuck are you then? Yoda, or Mr, Myagui
Raz
27th May 2003 03:32 UTC
Atero don't yell at me like i'm a 6 year old :p "i don't use it anymore", i just took it off an old preset and stuck it in without thinking of the consequences of my old bad bad method of random speeding. :p Thats not exactly the most important part in my opinion anyway.
Wiser87
27th May 2003 08:17 UTC
Originally posted by Raz
Atero don't yell at me like i'm a 6 year old :p "i don't use it anymore", i just took it off an old preset and stuck it in without thinking of the consequences of my old bad bad method of random speeding. :p Thats not exactly the most important part in my opinion anyway.
You mean Raz
isn't a 6 year old? :p
*runs like hell!*
Tuggummi
27th May 2003 09:04 UTC
DON'T use straight up getspec for random seeding![
And why not? Oh, if i remember right you said something about "it doesn't move when there is a quiet part in the song"
Uhm... Correct me if im wrong, but isn't that the whole fucking idea? :p It reacts when there is music and it doesn't react when there isn't music. I really can't understand your logic here.. do you want to make animations or visuals? Or is this just a pissing contest on "how fucking 1337 i am" ? :weird:
[Ishan]
27th May 2003 09:13 UTC
You mean Raz isn't a 6 year old?
*runs like hell!*
:D
Jaheckelsafar
27th May 2003 09:26 UTC
As long as it works the way you want it to; that's all that matters.
shreyas_potnis
27th May 2003 09:46 UTC
I agree with Tugg. Synching isnt possible without using getspec/getosc OR typing long complicated code like in some of UnconeD's presets OR using a fake random genereator.
sidd
27th May 2003 09:48 UTC
or of you want it to move even when its quiet: getspec+constant
dirkdeftly
27th May 2003 17:01 UTC
umm. fyi getspec/getosc is impossible to predict and when there's a beat it's going to be loud anyway. the problem is getspec doesn't do well because it's always weighted towards one axis and getosc tends toward 0. not only that but you can get beats that are abnormally low in dB, meaning that every getosc value returned is rather low, almost stopping the scope entirely. needless to say that's really unnatural and really annoying. furthermore, if you do want a weighted random seeding, there's better ways to do it (e.g. sin/cos of variables already in place).
last but not least, how the fuck do you expect that scope to simply stop when the song stops? think of it this way: you've just had a BIG beat go off and all of a sudden the scope is spinning like mad, then the song cuts out and moves on. that's not exactly my idea of reactivity.
is that enough for you?
C.G.
27th May 2003 18:38 UTC
ohh and in the first place i thought those 15 replies were comments on my preset...
anyway those things about getspec/getosc seems to be equally interesting... so its ok i guess :)
anubis2003
28th May 2003 01:20 UTC
Atero, you can use straight up getosc for random seeding without it jumping around too quickly - you just have to make it go smoother:
BEAT:
ddy=getosc(.5,0,1);
FRAME:
dy=dy*.99+ddy*.01;
PIXEL:
x=2*i-1+.3*v;
y=dy;
There's no reason to go and slow it down using your long line of code when something simple will do.
dirkdeftly
28th May 2003 02:05 UTC
anubis, i know that. you can do that with straight random seeding as well. but that doesn't change the fact that it's EXTREMELY uneven, whether you smooth it out or not.
and for christ's sake, what is the point of not using the modulus method if it looks better and it only takes four extra commands? jeez...
<edit> btw, an extra line of code with two operands operating on two variables slows it down a whole lot more than those four extra operands every beat </edit>
sidd
28th May 2003 06:20 UTC
Ok, for one.. using the getspec/getosc way CAN be better, because it reacts more specifically to the music. All of the things you mentioned can be smited quite easily.
eg, to stop it only reacting on beats, dont use the beat method:
Per frame:
t=t+getspec(0,0.3,0)*0.05;
per Point:
y=sin(t)*0.1+v*0.05; x=2*i-1;
now the scope will simply stop when the song stops.
Add a constant to the per frame line to make it always move, but speed up when the music is louder.
Plus you could add a decaying constant (ob: bt=1, pf: bt=bt*0.95) to maintain beat reactivity.
But if you need to be able to predict future beats or recall past ones, then yes, you have to use the modulus method. Also, you can create more eratic/random randomisers with this. As you can see, it depends on what you want your scope to do, either may be better, or even both at once.
Dont forget atero, people dont just use specdata because they think its better, but also because they dont know how to use the modulus method properly. Maybe you, or anyone who understands it better than me should try to explain it in depth either here or on the tips and tricks thread.
Tuggummi
28th May 2003 09:09 UTC
pissing contest on "how fucking 1337 i am"
:p
dirkdeftly
28th May 2003 21:56 UTC
siddhartha: yes, i've done that many times (btw, that's t=t*0.95...;, otherwise t is unbounded). however using getosc syncing onbeat is a BAD idea for reasons i stated above.