Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actual___

Posted 26 April 2013 - 03:35 AM

lets see your code:

 





  void ikt_viewPort3d_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            unsafe
            {
                
                float winX, winY, winZ;
                ilkTikYapildi = true;
                Int32[] viewPort = new Int32[4];
                GL.glGetIntegerv(GL.GL_VIEWPORT, viewPort);
                double[] modelView = new double[16];
                GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelView);
                double[] projection = new double[16];
                GL.glGetDoublev(GL.GL_PROJECTION_MATRIX, projection);
                winX = eXPre = (float)e.X;
                winY = eYPre = (float)e.Y;
                winY = viewPort[3] - winY;
                byte[] byt = new byte[4];
                float[] flt=new float[4];
                uint[] pix=new uint[1];
                GL.glEnable(GL.GL_DEPTH_TEST);
                GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);// and why are you using it
                GL.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);// and why are you using it
                GL.glFinish();// and why are you using it
                GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, byt);//wtf man
                winZ = System.BitConverter.ToSingle(byt, 0);//wtf man
   
             uint[] den1 = new uint[100];<-- since when float result is uint[100]

                GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, den1);//here its okay but should be integers without cast
                winZ = den1[0];//no comments
          
     
                //now see this code below and compare it  with mine
                double objX, objY, objZ;
                GL.gluUnProject(winX, winY, aktifZoomDegeri, modelView, projection, viewPort, out objX, out objY, out objZ);
              why the f*** are you using here floats????????? and wtf is aktifzoomdegeri dont even tell me i dont want to know
            }

        }
    }



i told you to make it like mine but you use floats instead integers, floats instead doubles and aktifzoomdegeri is what? should be winZ (in your code it should be den1 cast to double since den1 should be float (make new variable and cast to it), i am tired of telling you this over and over and over again.


#2___

Posted 26 April 2013 - 03:33 AM

lets see your code:

 



  void ikt_viewPort3d_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            unsafe
            {
                
                float winX, winY, winZ;
                ilkTikYapildi = true;
                Int32[] viewPort = new Int32[4];
                GL.glGetIntegerv(GL.GL_VIEWPORT, viewPort);
                double[] modelView = new double[16];
                GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelView);
                double[] projection = new double[16];
                GL.glGetDoublev(GL.GL_PROJECTION_MATRIX, projection);
                winX = eXPre = (float)e.X;
                winY = eYPre = (float)e.Y;
                winY = viewPort[3] - winY;
                byte[] byt = new byte[4];
                float[] flt=new float[4];
                uint[] pix=new uint[1];
                GL.glEnable(GL.GL_DEPTH_TEST);
                GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);// and why are you using it
                GL.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);// and why are you using it
                GL.glFinish();// and why are you using it
                GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, byt);
                winZ = System.BitConverter.ToSingle(byt, 0);
   
             uint[] den1 = new uint[100];<-- since when float result is uint[100]

                GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, den1);//here its okay but should be integers without cast
                winZ = den1[0];//no comments
          
     
                //now see this code below and compare it  with mine
                double objX, objY, objZ;
                GL.gluUnProject(winX, winY, aktifZoomDegeri, modelView, projection, viewPort, out objX, out objY, out objZ);
              why the f*** are you using here floats????????? and wtf is aktifzoomdegeri dont even tell me i dont want to know
            }

        }
    }



i told you to make it like mine but you use floats instead integers, floats instead doubles and aktifzoomdegeri is what? should be winZ (in your code it should be den1 cast to double since den1 should be float (make new variable and cast to it), i am tired of telling you this over and over and over again.


#1___

Posted 26 April 2013 - 03:29 AM

lets see your code:

 

  void ikt_viewPort3d_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            unsafe
            {
                
                float winX, winY, winZ;
                ilkTikYapildi = true;
                Int32[] viewPort = new Int32[4];
                GL.glGetIntegerv(GL.GL_VIEWPORT, viewPort);
                double[] modelView = new double[16];
                GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelView);
                double[] projection = new double[16];
                GL.glGetDoublev(GL.GL_PROJECTION_MATRIX, projection);
                winX = eXPre = (float)e.X;
                winY = eYPre = (float)e.Y;
                winY = viewPort[3] - winY;
                byte[] byt = new byte[4];
                float[] flt=new float[4];
                uint[] pix=new uint[1];
                GL.glEnable(GL.GL_DEPTH_TEST);
                GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);// and why are you using it
                GL.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);// and why are you using it
                GL.glFinish();// and why are you using it
                GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, byt);
                winZ = System.BitConverter.ToSingle(byt, 0);
                MessageBox.Show("x : " + winX.ToString() + "y: " + winY.ToString() + "z: " + winZ.ToString());
                //IntPtr[] ptr=new IntPtr[100];
                //GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, ptr);
                ////winZ = ptr.ToInt32();
                //MessageBox.Show("x : " + winX.ToString() + "y: " + winY.ToString() + "z: " + winZ.ToString());
                uint[] den1 = new uint[100];

                GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, den1);
                winZ = den1[0];
                MessageBox.Show("x : " + winX.ToString() + "y: " + winY.ToString() + "z: " + winZ.ToString());

   
               // GL.glReadPixels((int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, byt);
                
                double objX, objY, objZ;
                GL.gluUnProject(winX, winY, aktifZoomDegeri, modelView, projection, viewPort, out objX, out objY, out objZ);
                //MessageBox.Show("x : " + winX.ToString() + "y: " + winY.ToString() + "z: " + winZ.ToString());
                MessageBox.Show("x : " + objX.ToString() + "y: " + objY.ToString() + "z: " + objZ.ToString());
            }

        }
    }



why its red? because i told you to make it like mine but you use floats instead integers, floats instead doubles and aktifzoomdegeri is what? should be winZ (in your code it should be den1 cast to double (make new variable and cast to it), i am tired of telling you this over and over and over again.


PARTNERS