Archive: new AVS with mouse/kb support


25th November 2003 16:23 UTC

new AVS with mouse/kb support
OK added a new eval function, getkbmouse(), that lets you query the mouse position, button states, and keyboard button states. I'll let you guys figure out the implications of this (interactive presets, games, whatnot). Here's the latest DLL:

http://firehose.net/~deadbeef/smp_avs_5.zip

Word. Try a superscope like this:


mousex=getkbmouse(1);
mousey=getkbmouse(2);
mousea=atan2(mousex,mousey);
x=(i-0.5)*mousex - v *0.5*cos(mousea);
y=(i-0.5)*mousey + v*0.5*sin(mousea);
red=if(getkbmouse(3),0,1);


-Justin

P.S. Edit:
"<THEMike> db|not|at|home: why say "I'll let you guys figure out the implications of this" then tell them what they are?"

Well, because you guys always blow me away, so what I think the implications are and what they will turn out to be will likely be very different =)

25th November 2003 16:24 UTC

mm. my erection can hardly be contained :)


25th November 2003 16:32 UTC

I made an AVSpaint preset, haha.
Turn off clear framebuffer, set blend mode to additive, and
superscope with n=2:


x=if(i,getkbmouse(1),lastx);
y=if(i,getkbmouse(2),lasty);
red=getkbmouse(3);
blue=red;
green=red;
lastx=if(i,x,lastx);
lasty=if(i,y,lasty);



ha ha.

25th November 2003 16:41 UTC

OMG yes!! The Matrix trilogy skin AVS will be the first to use it, we got some neat Texer 2 stuff in there that needs mouse support!! Justins been eatin his Wheaties.


25th November 2003 16:42 UTC

Awesome stuff! :D Going to play with it in a sec!


25th November 2003 17:17 UTC

now we still need $artist/$track/etc support in render/text :)


25th November 2003 17:21 UTC

And here's my first hacked up game, hehe.
based on unconed's and gaekwad2's presets.


25th November 2003 17:22 UTC

Thise is sweet Justin, now there is only two things i w8 :)
arrays and vectors ;)

[edit]
oh bloody darn! I just noticed how good is the mouse controlled rotation, fianly I dont have to worry if the face of plyherdon is in correct spot YAY!
And avs games, I am allready expecting something very cool from some ppl :]
A M A Z I N G
[/edit]


25th November 2003 17:44 UTC

hahah nice justin, thanks for the coding of the game saves us time!!


25th November 2003 18:04 UTC

\o/

if i find somewhere how rot. dalay works im gonna do 3d one also :)


25th November 2003 18:14 UTC

nice
very nice


25th November 2003 18:26 UTC

AVS games? I think once this becomes a trend, I might finally have a reason to install AVS. Very neat...


25th November 2003 18:48 UTC

so much for music visualization.


25th November 2003 18:49 UTC

"Reason to install AVS?"

Heathen!

By the way, nemo, mousecontrol might still be useful for VJing and such. Don't dismiss the idea.


25th November 2003 19:14 UTC

WTF!
hey with this version the fps doesn't jam into 32 or 64 animo (like it did with all the earlier versions) !!!! YAY!:eek:


25th November 2003 21:08 UTC

I'm not downloading all this until it is officially released so here's an idea for someone to work with. Since we can make games I think a real time DDR preset would rock


25th November 2003 21:32 UTC

:D :D

bestest creation evaarrrr


25th November 2003 22:03 UTC

Hmm, that sonic preset that zevensoft made is seeming like we'll be seeing something good in the not too distant future. :D

Thanks Justin. :up:


25th November 2003 22:05 UTC

Wow, this is sweet. Justin is tha man. A few months ago, all us avsers thought that avs wasn't going to be updated anymore. Now we got things we didn't even dream of. I think I speak for the whole AVS community, when I say: 'Thank you, Justin'!


25th November 2003 22:18 UTC

omfg this is fucking great! Now all I have to do is understand it :p


25th November 2003 22:20 UTC

If you dont mind me asking, when is Winamp 5 going to be officially released? I thought it was supposed to be in mid October?


25th November 2003 22:34 UTC

Who gives a fuck, as long there is no final version, updates like this can always happen :D. I love it. Btw, I think I'm getting a hang at this... sweeet :).


26th November 2003 00:07 UTC

Dec 4 is justins date

.plan


26th November 2003 01:11 UTC

Very nice! Blazer's right, no more locking to 64fps. Mouse controls - awesome! Check it out. Click and hold to ignite, use mouse position to control direction.

EDIT: I just hope you get the crashy bugs out of this version of AVS before it is released. So far it has crashed three times today while editing presets. Unfortunately I couldn't find any specific causes - just out of nowhere a hang, and then an end program popup. Again though, great work Justin!


26th November 2003 02:34 UTC

ack, sob... this just revolutionises avs.

sob

so many uses
...

however.. i still stand by the idea that vis' should be just a sit back and watch thingo.

but games are different, w00t!


26th November 2003 03:32 UTC

yay!!!!!! oh man this is just so f*cking sweet :D:D:D
oooh mouse sentivity would kick ass!!!:D:D


26th November 2003 06:19 UTC

Originally posted by NemoOrange
so much for music visualization.
I think that says it all.
I've got a gut feeling that this will tear apart the avs community into the "gamers" and into the "visualizers". Just like devart now has the more artistic avsters and the forums the more technical ones :hang:

But i know i might get a bit over-dramatic sometimes, so i will of course test it first. But aah, i don't want to be a test bunny. I will still wait for the final wa5, thank you.

But seems like you really pushed the forumers buttons ( heh heh :rolleyes: ) with this justin, points for you on that ;)

26th November 2003 06:39 UTC

Man I dont make avs's. I dont have the time. But I cant wait to see what you guys can do with this.


26th November 2003 07:52 UTC

it's going to be awesome :).


26th November 2003 08:01 UTC

just one problem tho, in fullscreen you cant use the click function(getkbmouse(3)) cause it closes if we do.


26th November 2003 08:11 UTC

Think about the possabliites, a 3d maze controled by keyboard, a mini rpg game or a mouse contoled DM bump :D :D :D
w00t w00t w00t

just imagine fragmer's Hybridium controled by mouse having a certain time limit to kill a certain amount of fish :D :D :D


26th November 2003 08:21 UTC

Code controlled effect lists. With the ability to turn off&on the el's with global variables or other vars. Now this would truly allow to make some real games without the lost of fps... Im just saying this because if there is really going to be avs games, then there should atleast be the tools to make some decent ones...

[edit]
okay, maybe not so real games, but a step more complex than pong's, worm or shooter games atleast...
[/edit]


26th November 2003 09:14 UTC

well, i think tug and nemo are being a tad dramatic.

I think this has definatly opened up a completely new avs field, but i dont think it will cause a split in the population. Myself, im planning on using it, no doubt about it, but that doesnt change how much i like to sit back and watch a good set of presets, without pressing buttons and moving the mouse.

Plus, this isnt the only new tool about, dont forget the countless evallib fixes and additions, colormod, global reg's etc, all of which arent really being explored by avsers yet, because they arent officially released.

I think you boys need to lighten up. This is a good thing. If people decide to switch to making games etc only, then they cant have been very good at visualisations in the first place, so it would be no great loss to the community.


26th November 2003 10:01 UTC

I guess this is usefull as a kind of optional use for vj'ing like UCD pointed out. Somehow similar to what i want do do with LiveFX, but not exactly.

Justin, we've got one bug here: if i use the mouse or keys, the standard actions will still be executed like popup menu opening on rightclick or switching to fullscreen/editor opening on double leftclick.
These should be disabled as soon as thei're defined within the code.


26th November 2003 11:32 UTC

I've got some feeling UnConeD is going to upgrade his Wolfenstein...
:)

Justin, you rule. This is just ... (GREAT*10^infinity)

And I agree with Magic and all the above when it comes to mouseclicking. Just keep the [Esc] function working, or else you can't return to normal mode.


26th November 2003 12:51 UTC

An attempt at a interface for one of my presets. Go to the left-top corner and click 'Mouse 1' for control over the rotation, click 'Mouse 2' for size and color control. Texer II is required for this preset.


26th November 2003 15:05 UTC

hehe man! with these new features the AVS-world is gonna change considerably.:):D


26th November 2003 15:35 UTC

Hmmm... Jack, think mathword polyhedra models, the way they're mouse controlled? :D


26th November 2003 17:15 UTC

justin will this for sure be in winamp 5 AVS?


26th November 2003 22:49 UTC

I'm happy and all, but please change the shortcut for fullscreen from doubleclick to something else. It really messes things up...


26th November 2003 22:56 UTC

You'll have to turn this off yourself in the AVS fullscreen options. Or if you use the modern skin you can configure it so the vis options buttons opens the config instead of the context menu (this should be a default IMO).


26th November 2003 23:04 UTC

Yeah that double click to full screen, put it back the way it was, double click for config.


27th November 2003 05:29 UTC

there only one fear i have in my mind about this new AVS , with this new technology AVS n00bs like me who are still learning will no longer be recognized:(


27th November 2003 06:02 UTC

You do avs to be recognized?

Man, you're totally lost... :hang:


27th November 2003 06:17 UTC

nay tuggummi, it is you who is lost.

Avs is a tool to aid the recognition of geeks world wide. Need i direct you to the good book?

Chapter 1, Verse 2, the purposes of the holy tool:

"Advanced Visualisation Studio: What we (at Nullsoft) use to (try to) get chicks at parties"

amen


27th November 2003 06:40 UTC

heh, amen to that then :)


27th November 2003 07:24 UTC

Originally posted by WhiteRayven
Yeah that double click to full screen, put it back the way it was, double click for config.
Settings->Fullscreen Settings
[Checkbox] Doubleclick in main window goes fullscreen (instead of config)
;)

27th November 2003 14:41 UTC

hey tugg i do AVS for fun as well as to be recognized:)


27th November 2003 16:06 UTC

I found out a nice trick while coding interactive rotation on a DM. First I had the following code (state=1 means that the user has switched to interactive mode 1, more modes can ofcourse be coded as well):


init:
state=1

frame:
mxo=mx;myo=my;
mx=getkbmouse(1);
my=getkbmouse(2);
pl=if(below(abs(mx),1)*below(abs(my),1),getkbmouse(3),pl);

r1d=if(pl,atan2(mx,my),rmr);
r1=if(equal(state,1),r1*0.9+r1d*0.1,r1+r1r);

beat:
r1r=rand(10)/100-0.05;

pixel:
r=r+r1;d=d*0.5;


It seems nice until you move over the mark between -pi and pi. The screen rotates very fast in the other direction, covering almost an entire circle. This is because of the r1=r1*0.9+r1d*0.1 interpolation. It does needs this, to make the rotation smooth. Otherwise the screen would jump if the user clicked somewhere.

I fixed this problem by checking if the interpolation is being done between either r1o<-0.5*pi and r1d>0.5*pi (r1o the last rotation, r1d the new one), ot r1o>0.5*pi and r1d<-0.5*pi. The coded version of that follows below:


init:
state=1;

frame:
mxo=mx;myo=my;
mx=getkbmouse(1);
my=getkbmouse(2);
pl=if(below(abs(mx),1)*below(abs(my),1),getkbmouse(3),pl);

r1o=if(pl,atan2(mxo,myo),r1o);
r1d=if(pl,atan2(mx,my),r1d);
r1f=if(pl*bor(below(r1d,-0.5*$pi)*above(r1o,0.5*$pi),above(r1d,0.5*$pi)*
below(r1o,-0.5*$pi)),r1f-above(r1d,0.5*$pi)+below(r1d,-0.5*$pi),r1f);
r1=if(equal(state,1),r1*0.9+(r1d+r1f*2*$pi)*0.1,r1+r1r);

beat:
r1r=rand(10)/100-0.05;

pixel:
r=r+r1;d=d*0.5;


Try the two differents DM's and see the difference. I hope this will help you fix the problem if it happens in one of your own presets.

27th November 2003 16:17 UTC

Skupers: For angle interpolation, I use:

a=a+sin(ta-a)*.1;

Works fine, except if the difference between ta and a is close to 180°.


27th November 2003 19:18 UTC

When I try making your code go round in circles, sometimes it rotates a bit in the wrong direction. Is this that problem with 180 or is it just my preset?


27th November 2003 21:23 UTC

I have the perfect idea for the fullscreen shortcut problem. A function that changes the hotkeys within the preset (like fullscreen(getkbmouse(whatever)) or something).

A shitty demo preset:


28th November 2003 13:57 UTC

nice one atero. Maybe someone can remake UCD's Whacko AVS 6 - Strange Recursion.(i'm trying)


28th November 2003 15:06 UTC

How do I know which keyboard key has which number?


28th November 2003 15:50 UTC

if you take out all the keys, youll find that the number is written on the backside of each key.

:)

or not


28th November 2003 15:59 UTC

That's not true, I tried it ;). Me dumb fuck. Still, I also like to know which number is which key.


28th November 2003 16:06 UTC

www.asciitable.com
and oh yeah, avs reads all letters as caps so ignore the other letters


28th November 2003 21:11 UTC

OMG...AVS got a huge boost since i last visited the forums...gotta check out all these new things :D


28th November 2003 22:19 UTC

ditto.


29th November 2003 04:33 UTC

Gah with all these different threads, I misposted ;).

Correct keycode listing at:
http://forums.winamp.com/showthread.php?threadid=157731
It's not ASCII.