Jump to content
  • Advertisement

Mystery

Member
  • Content Count

    232
  • Joined

  • Last visited

Community Reputation

136 Neutral

About Mystery

  • Rank
    Member
  1. Anyone can help? These are my codes: Image iconImage(L"c:\\Icon1.gif"); DWORD palSize = iconImage.GetPaletteSize(); ColorPalette* ppal = (ColorPalette*)new BYTE[palSize]; iconImage.GetPalette(ppal, palSize); int count = ppal->Count; for (int ii=0; ii<count; ii++) { Color color1 = ppal->Entries[ii]; int red = color1.GetR(); int green = color1.GetG(); int blue = color1.GetB(); if (ii == 0) { ppal->Entries[ii] = Color::MakeARGB(0, 0, 0, 0); } else ppal->Entries[ii] = Color::MakeARGB(0xFF, red, green, blue); } iconImage.SetPalette(ppal); iconImage.Save(L"\\transparent.gif", &encoderClsid, NULL);
  2. I am trying to create a gif image file with transparent background using Visual C++. However I am unsuccessful in my attempt. This is what I did. I load an existing gif file with opaque background. Then I get the color palette out of the gif and set 0 to the alpha value of the color I want to be transparent i.e. the background color. However the background still appears opaque. Any advice appreciated. I am actually trying to follow the codes of this article: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315780#12
  3. Mystery

    Euler integration again

    Thanks for the input, John. It will take me some time to digest it though. :)
  4. Mystery

    Euler integration again

    Any comments? Is the semi-Impicit really as good as the verlet as mentioned by one poster?
  5. Mystery

    Euler integration again

    Explicit Euler algorithm: x' = x + v * dt v' = v + a * dt Semi-Implicit Euler algorithm: v' = v + a * dt x' = x + v * dt It was pointed out in an earlier thread that Explicit Euler might lead to stability problem because the x and v are stored separately this causing them to go out of sync. May I know if this problem still occur for Semi-Implicit Euler? Thanks.
  6. Mystery

    2D/3D relatioship

    Quote:Original post by Zipster True, but if he's trying to reconstruct the image then it's more than just projecting into 2D and being finished (which is where trying to undo the skew and distortion). This is actually a somewhat difficult problem. I would equate it to some sort of reverse anisotropic filtering where you only have limited data to start from and you have to reconstruct the rest as best you can. I don't have much experience in the actual details of many filtering methods so while I have a few rough ideas I'm not sure how well they'd work. You say you have 3D information data, does this involve a depth in addition to a color value, for instance? The 3D information is the 3D coordinate of each point and the texture mapping information so that I can map the 2D image onto the 3D model.
  7. Mystery

    2D/3D relatioship

    Quote:Original post by Zipster Oh OK, I think I see what you want to do. It either involves taking a 2D image and applying it do a 3D surface in such a way that you eliminate, or at least try to eliminate distortion due to skew; or it involves taking an image that's on a book in 3D and flattening into 2D while trying to reverse the effects of skew and distortion. Let me know if I'm on the right track! Yes, you are right. After digital 3D surface to 2D, I hope to remove the distortion/skew from the image. However, currently this is only reflected on the 3d model with texture map. I need to reflect the change on the 2D image as well.
  8. Mystery

    2D/3D relatioship

    Quote:Original post by Zipster You already have the mapping between world space and texture space, it's your UV axis (which you must have). However I'm not exactly clear what it is you're trying to accomplish by manipulating the points or what effect you want to achieve. I am doing a simulation that involves digital flattening a book. A 2D image is textured over the book. This information is provided by a 3D range scanner. After the digital flattening, the surface will look different in the 3D world. I wonder if it is possible to reflect this change on the 2D image as well.
  9. Mystery

    2D/3D relatioship

    Quote:Original post by oliii I don't understand. If you move the 3D points, the texture coords won't change automatically, unless, as you said, you have an 'environment' mapping function. Need an example, I guess. Yes, it would not change. I wonder if it is possible to derive a mapping fr just these 2 sets of data. I know for some cases, esp. those applications that derive 3D info from 2D image have something called a projection matrix.
  10. Mystery

    2D/3D relatioship

    Given a set of 3D points and its corresponding texture co-ordinates, is it possible to define a relationship(projection matrix?) between these 2 sets of data? After moving the 3D points through manipulation, I want the changes to be reflected on the 2D image as well. Thanks in advance.
  11. Mystery

    Verlet integration

    I am trying to find more info on verlet integration for my report. Can someone point me in the right direction? Where does it originate from or who actually invented it? Thanks. Btw, I learnt abt verlet integration from Advanced Character Physics by Thomas Jakobsen.
  12. Is it possible to save a simulation in OPENGL? It will just for presentation purposes thus do not need the entire program. Also no user input required. Just a simple simulation. Pls advise. Thank you.
  13. Mystery

    On command for menu item

    Quote:Original post by Kibble Threads are overkill for this problem. Just have your simulation have a function that simulates one step. Call this function once per frame, and process your window messages in between calls to this function. Thanks for the advice. :)
  14. Mystery

    On command for menu item

    Quote:Original post by Monder Threads which allow you to have two seperate threads of execution within a process could be used to solve this. You'd run all your simulation code in a seperate thread leaving the main thread to continue looking after the window (i.e. processing messages etc). May I know how to do that?
  15. Hi all, I have a menu system for my Visual C++ program. When I click on one of the menu items, I want it to run a simulation. However, once the simulation(OpenGL) starts, I cannot the move the window until the simulation ends(exit from the on_comand method of that menu item). How should I resolve this problem? I want to to be able run the simulation and at the same time able to resize/move or even do other stuff. Regards
  • 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!