Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Jun 2003
Offline Last Active Dec 04 2014 04:59 PM

Topics I've Started

Color swapping on OGL ES 2

04 May 2009 - 10:55 AM

Hi all. I am creating a 2D game on OGL ES for iPhone. I want the player to be able to customize his character's color (For example, his character is a dog. He could change his main color to brown, white, etc). Now, lets suppose this is the image of my dog (thanks google images): http://dogs.thefuntimesguide.com/images/free/puppy-dog-face.jpg As you can see, he has different shades of brown, and some parts of the image which will not be colored/tinted (tongue, eyes, teeth, black outline). What is the best way to do this coloring? Is there a way could define a grayscale image (texture?) and add color to this? Ive searched on google, and found this: http://stackoverflow.com/questions/662440/palette-animation-in-opengl "Currently I am doing it with 2 textures: white texture under the other texture, translated the specific pixel color into transparent, then I change white texture color with glColor3f() function to what ever I want, and I see the "palet animation" on that specific color." This seems to be kinda what i want, but will the glColor color the gray's accordingly? I dont have too much experience with OGL, so any help or guidance will be greatly appreciated! :)

OpenGL 2D clip

22 January 2009 - 09:00 AM

Hey guys, long time no post. I've been doing a game in 2D using ogl for some time. I am kinda new to opengl but i manage. I am kinda stuck though when trying to make some kind of clipping to the thngs i am drawing. I have an image of a television. When i turn it on on my game, i want it to render the game inside the television (so basically, i want a the scene to be rendered only on this rectangular region, and any part of the scene outside this television will not be drawn). I could fake this by separating the tv into layers, one at the front (frame) then back, and then draw the scene in between. Thing is, i dont want to do this. Is it possible to set like a clip or something similar in open gl? Thanks in advance!

2D collisions between objects.

28 February 2006 - 04:16 PM

Hi. I am making an algorithm for collisions between two objects, whose boundaries are delimited by a rectangle (AABB). Now, I was thinking each object should handle his collisions how he sees fit. So he receives a message that he collided and who he collided with. My question arises on the following example. Rhino 1 is going left, velocity is x=-1 y=0, and Rhino 2 is going right, velocity is x=1 y=0. I want each rhino to change to a random direction(except the current one) when they collide. What happens is that i'm making each Rhino advance till they overlap, and on the OnCollisionMessage(sender, receiver) event i get what direction they were facing, and I substract the velocity before changing the direction. Rhino 1 would first add 1 to Rhino1.X and then choose a random direction. Rhino 2 would decrease Rhino2.X by 1 and then choose the direction. What happens is that if i have several other objects on the map, this scheme is totally messed up, since on one side there could be an overlapping object, and then when substracting the velocity to the position, the new position overlaps with the other object, making it impossible to fix. If you don't understand this, i could post a pic. Either way, do you have any suggestion as how to tackle this problem? Are the objects supposed to manage the collisions by themselves, or should there be an omnipotent class that will handle all collisions of objects and reposition them as it sees fit? I kinda reached a dead end and i'm clueless which way I should continue. Thanks in advance!

[.net] Managed DirectX for mapmaker...

08 November 2005 - 10:49 AM

Hello, I've made a mapmaker on C# default GDI+ libraries(Graphics, Bitmap, etc.), but, as you all may pressume, it has slown down quite a bit... Tiles are coming from different files, but i convert them all to the same palette. Now, I was trying to gain performance on the map editor, and I think the solution is DirectX. (1) Is it too much of a refactor to port my code to DX? (2) What about the images? I read somewhere that the sprites, in order to gain some speed should all be on the same bitmap, and then, when painting, just move the clipping rectangle from tile to tile. (3) Would it be advisable that I port this app to DX or is there some kind of trick i'm missing about GDI+?? Thanks for reading and even greater thanks for responding.