XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Screensaver/Visualization Developement

Screensaver/Visualization Developement Create beautiful presets for XBMC's exclusive Vortex 3D Visualizer

Reply
 
Thread Tools Search this Thread Display Modes
Old 2006-10-03, 20:36   #1
morte0815
Member
 
morte0815's Avatar
 
Join Date: Sep 2004
Location: Germany
Posts: 61
morte0815 is on a distinguished road
Default [Transition] Taskswitch.tra

This one is inspired by the Vista-Taskswitch (i dont know how the topmost window gets to the back, so i created my own way)

PHP Code:
// Taskswitch.tra
// Author - morte0815

float time;
Texture background;

void Init()
{
  
time 0;
  
background.LoadTexture("Plasma_edge.jpg");

}

void DrawFrame()
{
  
gfxSetTexture(background);
  
gfxTexRect(-1.1f1.1f1.1f, -1.1f);   
}

void TexRect(float topfloat bottomfloat leftfloat right
float ttopfloat tbottomfloat tleftfloat tright)
{
  
gfxBegin(PRIM_QUADLIST);
    
gfxTexCoord(tleft,ttop);
    
gfxVertex(left,top,0);
    
gfxTexCoord(tright,ttop);
    
gfxVertex(right,top,0);
    
gfxTexCoord(tright,tbottom);
    
gfxVertex(right,bottom,0);
    
gfxTexCoord(tleft,tbottom);
    
gfxVertex(left,bottom,0); 
  
gfxEnd();
}

void Render()
{

gfxSetAspect(0);
  
time += TIMEPASS;
//   gfxSetBlendMode(BLEND_ADD);
//   float angle = time - 1.5f;
//   if (angle < 0){ angle = -angle;}
//   angle = 1.5f - angle; 
//   gfxRotate(Pow(360,angle*2),0,0,1);
     
if (time 1.0f){
       
gfxTranslate(002.414+time*2);
       
gfxRotate(-65*time,0,1,0);
       
gfxTranslate(00, -time/2.0f);
       
gfxPushMatrix();
       
       
       
gfxTranslate(001);
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
gfxTexRect(-111, -1);
   } 
   if (
time 1.0f && time 2.0f)
   {
      
gfxTranslate(004.414);
      
gfxRotate(-65,0,1,0);
      
gfxTranslate(00, -0.5f);
       
gfxPushMatrix();
       
       
gfxTranslate(001-(time-1));
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
gfxPushMatrix();
       
gfxTranslate(0,(time-1)*2,0);
       
gfxSetTexture(background);
       
TexRect(1.1f,0.0f,-1.1f,1.1f,1.0f,0.5f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(1,0,-1,1,1.0f,0.5f,0.0f,1.0f);
       
       
gfxPopMatrix();
       
gfxTranslate(0,(1-time)*2,0);
       
gfxSetTexture(background);
       
TexRect(0.0f,-1.1f,-1.1f,1.1f,0.5f,0.0f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(0,-1,-1,1,0.5f,0.0f,0.0f,1.0f);
   }
    if (
time 2.0f)
   {
      
gfxTranslate(004.414-(time-2)*2);
      
gfxRotate(-65+(time-2)*65,0,1,0);
      
gfxTranslate(00, -0.5f);
       
gfxPushMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
      
   }

  if (
time>=3){
    
FINISHED true;
  }
        

In this one there is still a bug (the textures tear when the splitted window is shifted away), but i dont know why, so i cant fix it. Maybe someone else finds the bug.

Cya
morte0815 is offline   Reply With Quote
Old 2006-10-03, 21:48   #2
MrC
Team-XBMC Developer
 
MrC's Avatar
 
Join Date: Jan 2004
Location: England
Posts: 55
MrC is on a distinguished road
Default

Outstanding!

I didn't notice any tearing here.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


MrC is offline   Reply With Quote
Old 2006-10-03, 23:33   #3
morte0815
Member
 
morte0815's Avatar
 
Join Date: Sep 2004
Location: Germany
Posts: 61
morte0815 is on a distinguished road
Default

Quote:
Originally Posted by MrC View Post
Outstanding!

I didn't notice any tearing here.
THANKS!!

You can see the tearing if you use this version (it stops at the splitting of the current visualization):
PHP Code:
// Taskswitch_tearing.tra
// Author - morte0815

float time;
Texture background;

void Init()
{
  
time 0;
  
background.LoadTexture("Plasma_edge.jpg");

}

void DrawFrame()
{
  
gfxSetTexture(background);
  
gfxTexRect(-1.1f1.1f1.1f, -1.1f);   
}

void TexRect(float topfloat bottomfloat leftfloat right
float ttopfloat tbottomfloat tleftfloat tright)
{
  
gfxBegin(PRIM_QUADLIST);
    
gfxTexCoord(tleft,ttop);
    
gfxVertex(left,top,0);
    
gfxTexCoord(tright,ttop);
    
gfxVertex(right,top,0);
    
gfxTexCoord(tright,tbottom);
    
gfxVertex(right,bottom,0);
    
gfxTexCoord(tleft,tbottom);
    
gfxVertex(left,bottom,0); 
  
gfxEnd();
}

void Render()
{

gfxSetAspect(0);
  
time += TIMEPASS;
//   gfxSetBlendMode(BLEND_ADD);
//   float angle = time - 1.5f;
//   if (angle < 0){ angle = -angle;}
//   angle = 1.5f - angle; 
//   gfxRotate(Pow(360,angle*2),0,0,1);
     
if (time 1.0f){
       
gfxTranslate(002.414+time*2);
       
gfxRotate(-65*time,0,1,0);
       
gfxTranslate(00, -time/2.0f);
       
gfxPushMatrix();
       
       
       
gfxTranslate(001);
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
gfxTexRect(-111, -1);
   } 
   if (
time 1.0f )
   {
      
gfxTranslate(004.414);
      
gfxRotate(-65,0,1,0);
      
gfxTranslate(00, -0.5f);
       
gfxPushMatrix();
       
       
gfxTranslate(001);
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
gfxPushMatrix();
       
gfxTranslate(0,0,0);
       
gfxSetTexture(background);
       
TexRect(1.1f,0.0f,-1.1f,1.1f,1.0f,0.5f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(1,0,-1,1,1.0f,0.5f,0.0f,1.0f);
       
       
gfxPopMatrix();
       
gfxTranslate(0,0,0);
       
gfxSetTexture(background);
       
TexRect(0.0f,-1.1f,-1.1f,1.1f,0.5f,0.0f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(0,-1,-1,1,0.5f,0.0f,0.0f,1.0f);
   }

  if (
time>=3){
    
FINISHED true;
  }
        

morte0815 is offline   Reply With Quote
Old 2006-10-04, 01:50   #4
pike
Project Manager
 
pike's Avatar
 
Join Date: Sep 2003
Location: Sweden
Posts: 4,281
pike is on a distinguished road
Send a message via MSN to pike
Default

maybe add some randomness so it does the transition in more than direction ?
__________________
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first.


pike is offline   Reply With Quote
Old 2006-10-04, 02:17   #5
morte0815
Member
 
morte0815's Avatar
 
Join Date: Sep 2004
Location: Germany
Posts: 61
morte0815 is on a distinguished road
Default

Since i cant edit my posts anymore (ADMIN!!!!!!!! ) here is a version with some randomnes:

PHP Code:
// taskswitch.tra
// Author - morte0815

float time;
Texture background;
float angleA;
float angleB;
float vertical;


void Init()
{
  
time 0;
  
background.LoadTexture("Plasma_edge.jpg");
  
angleA Rand() * 180 90;
  
angleB Rand() * 180 90;
  
vertical Rand();
}

void DrawFrame()
{
  
gfxSetTexture(background);
  
gfxTexRect(-1.1f1.1f1.1f, -1.1f);   
}

void TexRect(float topfloat bottomfloat leftfloat right
float ttopfloat tbottomfloat tleftfloat tright)
{
  
gfxBegin(PRIM_QUADLIST);
    
gfxTexCoord(tleft,ttop);
    
gfxVertex(left,top,0);
    
gfxTexCoord(tright,ttop);
    
gfxVertex(right,top,0);
    
gfxTexCoord(tright,tbottom);
    
gfxVertex(right,bottom,0);
    
gfxTexCoord(tleft,tbottom);
    
gfxVertex(left,bottom,0); 
  
gfxEnd();
}

void Render()
{

gfxSetAspect(0);
  
time += TIMEPASS;
     if (
time 1.0f){
       
gfxTranslate(002.414+time*2);
       
gfxRotate(angleA*time,0,1,0);
       
gfxRotate(angleB*time,1,0,0);
       
gfxTranslate(00, -time/2.0f);
       
gfxPushMatrix();
       
       
       
gfxTranslate(001);
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
gfxTexRect(-111, -1);
   } 
   if (
time 1.0f && time 2.0f)
   {
      
gfxTranslate(004.414);
      
gfxRotate(angleA,0,1,0);
       
gfxRotate(angleB,1,0,0);
      
gfxTranslate(00, -0.5f);
       
gfxPushMatrix();
       
       
gfxTranslate(001-(time-1));
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
gfxPushMatrix();
       if (
vertical >0.5f){
        
gfxTranslate(0,(time-1)*2,0);
       }
       else{
        
gfxTranslate((time-1)*2,0,0);
       }
       
gfxSetTexture(background);
       
TexRect(1.1f,0.0f,-1.1f,1.1f,0.0f,0.5f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(1,0,-1,1,0.0f,0.5f,0.0f,1.0f);
       
       
gfxPopMatrix();
       if (
vertical>0.5f){
        
gfxTranslate(0,(1-time)*2,0);
       }
       else{
        
gfxTranslate((1-time)*2,0,0);
       }
       
gfxSetTexture(background);
       
TexRect(0.0f,-1.1f,-1.1f,1.1f,0.5f,1.0f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(0,-1,-1,1,0.5f,1.0f,0.0f,1.0f);
   }
    if (
time 2.0f)
   {
      
gfxTranslate(004.414-(time-2)*2);
      
gfxRotate(angleA+(time-2)*-angleA,0,1,0);
      
gfxRotate(angleB+(time-2)*-angleB,1,0,0);
      
gfxTranslate(00, -0.5f);
       
gfxPushMatrix();
       
        if (
vertical>0.5f){
        
gfxTranslate(0,(time-1)*2,0);
       }
       else{
        
gfxTranslate((time-1)*2,0,0);
       }
       
gfxSetTexture(background);
       
TexRect(1.1f,0.0f,-1.1f,1.1f,0.0f,0.5f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(1,0,-1,1,0.0f,0.5f,0.0f,1.0f);
       
       
gfxPopMatrix();
       
gfxPushMatrix();
       
       if (
vertical>0.5f){
        
gfxTranslate(0,(1-time)*2,0);
       }
       else{
        
gfxTranslate((1-time)*2,0,0);
       }
       
gfxSetTexture(background);
       
TexRect(0.0f,-1.1f,-1.1f,1.1f,0.5f,1.0f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(0,-1,-1,1,0.5f,1.0f,0.0f,1.0f);
       
       
gfxPopMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
      
   }
  if (
time>=3){
    
FINISHED true;
  }
        


Last edited by morte0815; 2006-10-04 at 02:33.
morte0815 is offline   Reply With Quote
Old 2006-10-09, 23:20   #6
MrC
Team-XBMC Developer
 
MrC's Avatar
 
Join Date: Jan 2004
Location: England
Posts: 55
MrC is on a distinguished road
Default

When it splits the current preset the textures coords are wrong and it draws it upside down. I am not sure if this is the tearing you are talking about or not. Anyway, the fixed version is below. I have also removed a few gfxTranslate functions as it was jumping at the end due to not being at the correct z position. You will probably have a better idea how to fix that than me.

PHP Code:
// Taskswitch.tra
// Author - morte0815

float time;
Texture background;

void Init()
{
  
time 0;
  
background.LoadTexture("Plasma_edge.jpg");

}

void DrawFrame()
{
  
gfxSetTexture(background);
  
gfxTexRect(-1.1f1.1f1.1f, -1.1f);   
}

void TexRect(float topfloat bottomfloat leftfloat right
float ttopfloat tbottomfloat tleftfloat tright)
{
  
gfxBegin(PRIM_QUADLIST);
    
gfxTexCoord(tleft,ttop);
    
gfxVertex(left,top,0);
    
gfxTexCoord(tright,ttop);
    
gfxVertex(right,top,0);
    
gfxTexCoord(tright,tbottom);
    
gfxVertex(right,bottom,0);
    
gfxTexCoord(tleft,tbottom);
    
gfxVertex(left,bottom,0); 
  
gfxEnd();
}

void Render()
{

gfxSetAspect(0);
  
time += TIMEPASS;
//   gfxSetBlendMode(BLEND_ADD);
//   float angle = time - 1.5f;
//   if (angle < 0){ angle = -angle;}
//   angle = 1.5f - angle; 
//   gfxRotate(Pow(360,angle*2),0,0,1);
     
if (time 1.0f){
       
gfxTranslate(002.414+time*2);
       
gfxRotate(-65*time,0,1,0);
//       gfxTranslate(0, 0, -time/2.0f);
       
gfxPushMatrix();
       
       
       
gfxTranslate(001);
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
gfxTexRect(-111, -1);
   } 
   if (
time 1.0f && time 2.0f)
   {
      
gfxTranslate(004.414);
      
gfxRotate(-65,0,1,0);
//      gfxTranslate(0, 0, -0.5f);
       
gfxPushMatrix();
       
       
gfxTranslate(001-(time-1));
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
       
       
       
gfxPopMatrix();
       
gfxPushMatrix();
       
gfxTranslate(0,(time-1)*2,0);
       
gfxSetTexture(background);
       
TexRect(1.1f,0.0f,-1.1f,1.1f,1.0f,0.5f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(1,0,-1,1,0.0f,0.5f,0.0f,1.0f);
       
       
gfxPopMatrix();
       
gfxTranslate(0,(1-time)*2,0);
       
gfxSetTexture(background);
       
TexRect(0.0f,-1.1f,-1.1f,1.1f,0.5f,0.0f,0.0f,1.0f);
       
gfxSetTexture(TEXTURE_CURRPRESET);
       
TexRect(0,-1,-1,1,0.5f,1.0f,0.0f,1.0f);
   }
    if (
time 2.0f)
   {
      
gfxTranslate(004.414-(time-2)*2);
      
gfxRotate(-65+(time-2)*65,0,1,0);
//      gfxTranslate(0, 0, -0.5f);
       
gfxPushMatrix();
       
       
DrawFrame();
       
gfxSetTexture(TEXTURE_NEXTPRESET);
       
gfxTexRect(-111, -1);
      
   }

  if (
time>=3){
    
FINISHED true;
  }
        

__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


MrC is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DVDPlayer DVD9 (dual-layer) transition freeze? aHorseofCourse XBMC for Xbox Specific Support 43 2007-04-28 18:58
[Transition] Spin.tra morte0815 Screensaver/Visualization Developement 1 2006-10-03 20:53
Alexpoets Transition Library snowmanx Plugin/Script (Python) Help and Support 0 2005-11-11 08:39
New Image Transition Library Alexpoet Plugin/Script (Python) Development 3 2004-12-29 07:08
'transition' spelt 'transistion' in settings sharpy_uk XBMC for Xbox Specific Support 2 2004-10-27 14:45


All times are GMT +2. The time now is 06:05.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project