hi!!
thanks but i think i m having problem with texture loading n binding.bcoz my application runs but halt n didnt show any thing. i m doing the following:
 
glEnable(GL_TEXTURE_2D);    
    num_texture= LoadBitmapFunction("explosion.bmp");
    glBindTexture(GL_TEXTURE_2D, num_texture);
    
     glBegin(GL_TRIANGLES);
      for (i=0; i<3; ++i)
      {
       glNormal3fv(normalL[3*p+i]);      
        if(mesh->texels)
        glTexCoord2f(mesh->texelL[f->points[i]][0],
        mesh->texelL[f->points[i]][1]);
       glVertex3fv(mesh->pointL[f->points[i]].pos);     
      }     
     glEnd();
    glDisable(GL_TEXTURE_2D);
 
and in loadBitmapFunction

int i, j=0; //Index variables
  id_texture++; // The counter of the current texture is increased
  if( (l_file = fopen(filename, "rb"))==NULL) return (-1); // Open the file for reading   
  fread(&fileheader, sizeof(fileheader), 1, l_file); // Read the fileheader   
  fseek(l_file, sizeof(fileheader), SEEK_SET); // Jump the fileheader
  fread(&infoheader, sizeof(infoheader), 1, l_file); // and read the infoheader
   l_texture = (byte *) malloc(infoheader.biWidth * infoheader.biHeight * 4);
      memset(l_texture, 0, infoheader.biWidth * infoheader.biHeight * 4);
 
  for (i=0; i < infoheader.biWidth*infoheader.biHeight; i++)
  {           
            // We load an RGB value from the file
            fread(&rgb, sizeof(rgb), 1, l_file);

            // And store it
            l_texture[j+0] = rgb.rgbtRed; // Red component
            l_texture[j+1] = rgb.rgbtGreen; // Green component
            l_texture[j+2] = rgb.rgbtBlue; // Blue component
            l_texture[j+3] = 255; // Alpha value
            j += 4; // Go to the next position
  }

 fclose(l_file); // Closes the file stream
 

   // glBindTexture(GL_TEXTURE_2D, id_texture); // Bind the ID texture specified by the 2nd parameter


    // The next commands sets the texture parameters
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // If the u,v coordinates overflow the range 0,1 the image is repeated
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // The magnification function ("linear" produces better results)
 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); //The minifying function

   // glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); // We don't combine the color with the original surface color, use only the texture map.

    // Finally we define the 2d texture
    glTexImage2D(GL_TEXTURE_2D, 0, 4, infoheader.biWidth, infoheader.biHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, l_texture);

    // And create 2d mipmaps for the minifying function
   // gluBuild2DMipmaps(GL_TEXTURE_2D, 4, infoheader.biWidth, infoheader.biHeight, GL_RGBA, GL_UNSIGNED_BYTE, l_texture);

    free(l_texture); // Free the memory we used to load the texture

 
    return (id_texture);

}

if u find the problem plzzzz suggest  me some solution

On 5/11/06, Hylke Donker <[EMAIL PROTECTED]> wrote:
                                               glBegin(GL_TRIANGLES);
                                               for(int i = 0;i < 3;i++)
                                               {
                                                       glNormal3fv(normals[3*p+i]); //set normal vector of that point
                                                       if(mesh->texels)
                                                               glTexCoord2f(mesh->texelL[f->points[i]][0],
mesh->texelL[f->points[i]][1]);
                                                       glVertex3fv(mesh->pointL[f->points[i]].pos); //Draw the damn triangle
                                               }
                                               glEnd();


From: "sana anwar" <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: [Lib3ds-devel] texture mapping problem
Date: Thu, 11 May 2006 16:10:03 +0500
MIME-Version: 1.0
Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by
bay0-mc5-f16.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 11
May 2006 04:13:20 -0700
Received: from sc8-sf-list1-b.sourceforge.net
(sc8-sf-list1-b.sourceforge.net [10.3.1.7])by sc8-sf-spam1.sourceforge.net
(Postfix) with ESMTPid 23C8989881; Thu, 11 May 2006 04:11:16 -0700 (PDT)
Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91]
helo=mail.sourceforge.net)by sc8-sf-list1.sourceforge.net with esmtp (Exim
4.30)id 1Fe94P-0004vG-K7for [email protected]; Thu, 11 May
2006 04:11:01 -0700
Received: from nz-out-0102.google.com ([64.233.162.205])by
mail.sourceforge.net with esmtp (Exim 4.44)id 1Fe93W-00029O-LHfor
[email protected]; Thu, 11 May 2006 04:11:01 -0700
Received: by nz-out-0102.google.com with SMTP id i11so132576nzh        for
<[email protected]>; Thu, 11 May 2006 04:10:06 -0700 (PDT)
Received: by 10.65.219.6 with SMTP id w6mr1258746qbq;        Thu, 11 May
2006 04:10:03 -0700 (PDT)
Received: by 10.65.54.2 with HTTP; Thu, 11 May 2006 04:10:03 -0700 (PDT)
X-Message-Info: LsUYwwHHNt0uAemwkXGElRlGh9t3N9mVBHmCLbrUV5c=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;        s=beta; d=gmail.com;

h=received:message-id:date:from:to:subject:mime-version:content-type;
b=Iled0g37vKQHO+2XBno4RQhXvJAROl9VEToF5vjM6CeEOq8q5W95hs7VXCzU32eBWA5e2nujNhgBP9ifTIdEflwKi6wjh8gmjVnJ9rtlSfnUYI4NJ+1a6mYNEPouohW4V906Kk051a6tD5rpJLnT2NnL3O5ZklzvmDsoa9pJd2A=
X-Spam-Score: 0.6 (/)
X-Spam-Report: Spam Filtering performed by sourceforge.net.See
http://spamassassin.org/tag/ for more details.Report problems to
http://sf.net/tracker/?func=add&group_id=1&atid=2000010.5 FROM_ENDS_IN_NUMS
    From: ends in numbers0.0 RCVD_BY_IP             Received by mail server
with no name0.1 HTML_30_40             BODY: Message is 30% to 40% HTML0.0
HTML_MESSAGE           BODY: HTML included in message
Errors-To: [EMAIL PROTECTED]
X-BeenThere: [email protected]
X-Mailman-Version: 2.0.9-sf.net
Precedence: bulk
List-Unsubscribe:
<https://lists.sourceforge.net/lists/listinfo/lib3ds-devel >,<mailto:[EMAIL PROTECTED]?subject=unsubscribe>
List-Id: Discussion about lib3ds < lib3ds-devel.lists.sourceforge.net>
List-Post: <mailto:[email protected]>
List-Help: <mailto: [EMAIL PROTECTED]?subject=help>
List-Subscribe:
<https://lists.sourceforge.net/lists/listinfo/lib3ds-devel>,<mailto: [EMAIL PROTECTED]?subject=subscribe>
List-Archive:
< http://sourceforge.net/mailarchive/forum.php?forum=lib3ds-devel>
X-Original-Date: Thu, 11 May 2006 16:10:03 +0500
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 11 May 2006 11:13:20.0889 (UTC)
FILETIME=[E96B2E90:01C674EB]

if any body help me!!!!
i cant be able to form texture coordinate.i have tried alot.
plz help me,i am attacing the project so u can see the real problem in it
n suggest some solution.


sana




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel

Reply via email to