Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. float problems [modified]

float problems [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shaderx
    wrote on last edited by
    #1

    I currently ran into a problem. It goes like this: I do some math here

    __x=Cam.front.x*tmp*tan(Cam.Tx)+Cam.right.x*tmp*tan(Cam.Ty);
    __y=Cam.front.y*tmp*tan(Cam.Tx)+Cam.right.y*tmp*tan(Cam.Ty);

    all fine and well .. my 2 variables are what were supposed to be, but when i try to assign them to a structure with more floats , all floats inside ( donno if realy ALL , but looked at some) become -1.#IND000 Anyone knows what could couse this thing ( and a solution wouldnt hurt either :D) Edit: floats that gets messed up : variables used in expresion ( Cam.front , Cam.right ) and the variable I asign the __x , __y inside the structure ( was Cam.dir)

    modified on Saturday, May 24, 2008 5:00 PM

    J 1 Reply Last reply
    0
    • S shaderx

      I currently ran into a problem. It goes like this: I do some math here

      __x=Cam.front.x*tmp*tan(Cam.Tx)+Cam.right.x*tmp*tan(Cam.Ty);
      __y=Cam.front.y*tmp*tan(Cam.Tx)+Cam.right.y*tmp*tan(Cam.Ty);

      all fine and well .. my 2 variables are what were supposed to be, but when i try to assign them to a structure with more floats , all floats inside ( donno if realy ALL , but looked at some) become -1.#IND000 Anyone knows what could couse this thing ( and a solution wouldnt hurt either :D) Edit: floats that gets messed up : variables used in expresion ( Cam.front , Cam.right ) and the variable I asign the __x , __y inside the structure ( was Cam.dir)

      modified on Saturday, May 24, 2008 5:00 PM

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      shaderx wrote:

      but when i try to assign them to a structure with more floats

      struct or union? Please post more code, so that we might be able to help you. Anyway see some blindfold suggestions. 1) Check the watch window for wrong watch expressions. http://www.codeproject.com/Feature/SubtleBugs.aspx?fid=343280&fr=26&select=2542205#xx2542205xx[^] 2) Make sure the optimizations are turned off. 3) Latest Visual Studio service pack installed? (Poor man's bugfix) :rolleyes: 4) Try clean and rebuild. (Poor man's bugfix) :rolleyes: Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      S 1 Reply Last reply
      0
      • J Jijo Raj

        shaderx wrote:

        but when i try to assign them to a structure with more floats

        struct or union? Please post more code, so that we might be able to help you. Anyway see some blindfold suggestions. 1) Check the watch window for wrong watch expressions. http://www.codeproject.com/Feature/SubtleBugs.aspx?fid=343280&fr=26&select=2542205#xx2542205xx[^] 2) Make sure the optimizations are turned off. 3) Latest Visual Studio service pack installed? (Poor man's bugfix) :rolleyes: 4) Try clean and rebuild. (Poor man's bugfix) :rolleyes: Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        S Offline
        S Offline
        shaderx
        wrote on last edited by
        #3

        Nevermind, think i found the problem.

        modified on Sunday, May 25, 2008 4:10 AM

        J 1 Reply Last reply
        0
        • S shaderx

          Nevermind, think i found the problem.

          modified on Sunday, May 25, 2008 4:10 AM

          J Offline
          J Offline
          Jijo Raj
          wrote on last edited by
          #4

          You did? :cool: Let us know what was it. Something interesting? :)

          _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

          S 1 Reply Last reply
          0
          • J Jijo Raj

            You did? :cool: Let us know what was it. Something interesting? :)

            _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

            S Offline
            S Offline
            shaderx
            wrote on last edited by
            #5

            was part my fault, a division by 0 that caused that , but its still wierd cose it works if i dont assing the value , but if i do , its messed up.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups