PDA

View Full Version : [Preset] Woofer.vtx


morte0815
2006-10-03, 16:14
Hi!

This is my first preset. I hope you like it.

// woofer.vtx
// Author - morte0815

float angle = 0;

void Init()
{

}

void Quad(float x, float y, float z, float width, float tu_u,float tv_l, float tu_b , float tv_r)
{
gfxBegin(PRIM_QUADLIST);
gfxTexCoord(tu_u, tv_l);
gfxVertex(x,y,z);
gfxTexCoord(tu_b, tv_l);
gfxVertex(x+width,y,z);
gfxTexCoord(tu_b, tv_r);
gfxVertex(x+width,y+width,z);
gfxTexCoord(tu_u, tv_r);
gfxVertex(x,y+width,z);


gfxEnd();
}


float Length(float x, float y)
{
return Sqrt(x*x+y*y);
}

void Render()
{
if (BASS>0.5f)angle += TIMEPASS*5;
if (BASS<0.5f)angle -= TIMEPASS*5;

gfxTranslate(0, 0, 25.0f);

gfxRotate(-100,1,0,0);
gfxRotate(angle,0,0,1);


gfxSetTexture(TEXTURE_ALBUMART);

for (int i = -10; i < 10; i++)
{
for ( int j = -10; j < 10; j++)
{
if (Length(i,j) <= 10)
{
float height=(Length(i,j)/10.0f*BASS);
height+=((10.0f-Length(i,j))/10.0f*TREBLE);
height+=((5.0f-Length(i,j))/10*MIDDLE);
Quad(i,j,height,1,(i+10)/20.0f,(j+10)/20.0f,(i+1+10)/20.0f,(j+1+10)/20.0f);
}
}
}




gfxEnd();

}

Now some Questions:
Is there a manual with all functions listed?
How do the environmentmaps work?

CYA Morte

spiff
2006-10-03, 16:35
YEYH for u!

Gamester17
2006-10-03, 18:23
only 'guide' so far is this => http://xbmc.org/forum/showthread.php?t=22365

Please feel free to add it to our online-manual (WIKI)

pike
2006-10-03, 19:38
Thanks Morte! Better docs are coming.
I'm quite impressed with your first preset, looking forward to seeing what else you can do, hehe

morte0815
2006-10-03, 20:25
--- gone to two new threads ----

pike
2006-10-03, 20:27
morte, would be good if you created one topic per item, much easier to get an overview then! and also mention the name in the topic name

morte0815
2006-10-03, 20:33
morte, would be good if you created one topic per item, much easier to get an overview then! and also mention the name in the topic name
OK, no problem!

MrC
2006-10-03, 21:43
Hey Morte, great work mate.

Thanks for taking the time to have a play with Vortex.

As mentioned the docs are currently being worked on but feel free to ask me if there is anything you need help with, but you seem to be doing quite well on your own.

Also let me know if there is anything you think needs adding, math functions etc.

Looking forward to more of your work.

Cheers!

morte0815
2006-10-03, 23:37
Hey Morte, great work mate.

Thanks for taking the time to have a play with Vortex.

As mentioned the docs are currently being worked on but feel free to ask me if there is anything you need help with, but you seem to be doing quite well on your own.

Also let me know if there is anything you think needs adding, math functions etc.

Looking forward to more of your work.

Cheers!

I have to thank you for giving us such a great tool to play with!:nod::nod:

I think some more explanation of the blending functions would be great and (if not already there) some functionality for specifying the alpha level of an texture would be great (for transitions, so you could smoothly blend them from a to b).