Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ OpenGL
i build a game that a ball fly in window and when hit the lines , the lines will Disappear and so on .. how i can do this ??
Posted 11-Dec-11 9:19am
Comments
Addy Tas at 11-Dec-11 14:23pm
   
Maybe a silly suggestion but what about overwriting the targeted line with the background?
 
Cheers, AT
tambores63 at 11-Dec-11 16:35pm
   
Not really a good idea in OpenGL
Addy Tas at 11-Dec-11 16:48pm
   
No idea why the hell i even sugested such a thing when i'm fully aware that you can remove the lines or even make them runaway from the ball. I guess it really is time to call it for today.
Sorry guys; sudden stroke of blondness.
Signing off for today, AT
SAKryukov at 11-Dec-11 19:25pm
   
Of course the initial suggestion would not work, tambores63 is right, but I think deletion of the lines if artificial problem. The question is not quite clear, though. If the line is simply blocked from view, it should not be removed, if this is a part of action, the object representing the line should be hidden or simply removed.
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

While drawing lines specify it's color with alpha value
glColor4f(R,B,G,A)
"A" means alpha value and define the transparency ,if it is equal to 1 then complete Opaque and if 0 then complete transparent.
By changing the alpha value of lines,your problem will be solve.
After collision make alpha value equal to 0 then it will be transparent and seems like disappear.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 210
2 BillWoodruff 205
3 Jochen Arndt 180
4 DamithSL 165
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 3 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100