Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Visualc

blend question

This topic is 5799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, my again.. i need a code for appeard and disappear a object (nurb, poly ,etc) vanishing it. thank''s

Share this post


Link to post
Share on other sites
Advertisement
I don''t Know If this Is the correct way but if you want
some kind of efect where your object is totaly opace and than it
slow goes to full transparencie you can enable blending and in the color of your object you can make some like this


float transparency = 1.0 //No tranparancy


then where you draw your object

you can

glColor4f(r, g , b, transparency);



and in another place


tranparency -= 0.1:


I don''t know if this is what you want but this in fact makes your object disapear

Share this post


Link to post
Share on other sites
thank you men, ¿where find this information?.. ¿you learned in this page?, ¿you read in a book?,¿where find easy information about extension?, ¿so that they serve?.

Share this post


Link to post
Share on other sites
you can find some information about blending and another cool things this page in the main page go to NeHe tuturials

ps:is my solucion what you where looking for ?

Share this post


Link to post
Share on other sites
one question? i need move the texture in the scene, i try that:

glLoadIdentity();
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glEnable(GL_TEXTURE);
glTranslatef(textras,textras,textras);
glMatrixMode(GL_MODELVIEW);
glFlush();


glEnable(GL_BLEND);
glLoadIdentity();
glEnable(GL_BLEND);
glDisable(GL_LIGHTING);
glColor4d(0,0,0,0.5);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glRotatef(lookupdown,1.0f,0,0);
glRotatef(sceneroty,0,1.0f,0);
glTranslatef(xtrans-50, ytrans-1, ztrans-550);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(90.0f,0.0f,0.0f,1.0f);
glScalef(2.0f,2.0f,2.0f);
glCallList(AguaG);
glFlush();
glDisable(GL_BLEND);

the problem is this code move all the textures in the scene, not only the textures in the list, i try with glpop and glpushmatriz but not work.... what is wrong?

Share this post


Link to post
Share on other sites
quote:
Original post by Visualc
one question? i need move the texture in the scene, i try that:

glLoadIdentity();
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glEnable(GL_TEXTURE);
glTranslatef(textras,textras,textras);
glMatrixMode(GL_MODELVIEW);
glFlush();


glEnable(GL_BLEND);
glLoadIdentity();
glEnable(GL_BLEND);
glDisable(GL_LIGHTING);
glColor4d(0,0,0,0.5);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glRotatef(lookupdown,1.0f,0,0);
glRotatef(sceneroty,0,1.0f,0);
glTranslatef(xtrans-50, ytrans-1, ztrans-550);
glRotatef(-90.0f,1.0f,0.0f,0.0f);
glRotatef(90.0f,0.0f,0.0f,1.0f);
glScalef(2.0f,2.0f,2.0f);
glCallList(AguaG);
glFlush();
glDisable(GL_BLEND);

the problem is this code move all the textures in the scene, not only the textures in the list, i try with glpop and glpushmatriz but not work.... what is wrong?


What you should try is this:

set up camera
glMatrixMode(GL_TEXTURE);
glTranslatef(offset_s, offset_t,0);
glMatrixMode(GL_MODELVIEW);
draw the object
glMatrixMode(GL_TEXTURE);
glTranslatef(-offset_s, -offset_t,0);
glMatrixMode(GL_MODELVIEW);
draw rest of objects

Hope this helps!


One by one, the peguins steal my sanity.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!