×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    Picture slicing

    I am working on 3D symbian game.I am facing a problem with images that i am using.I have created a rectangle using vertices for an image just exactly to fit it....say if the image is 20 by 20....i am creating vertices taking into account its width and height to be exact 20 each.This image consists of text and its showing diagonal lines with the rectangle drawn ,, so basically diagonal slicing...what am i missing?

  2. #2
    Registered User
    Join Date
    Oct 2010
    Posts
    31

    png image loading problem ,using orthographic projec

    i am trying to load png image on screen using orthographic projection using code given below

    GLubyte texCoords[] =
    {
    0, 1,
    1, 1,
    0, 0,
    1, 0
    };

    GLushort indices[]={
    0,1,2,0,1,2,
    1,3,2,1,3,2
    };


    // Set orthogonal projection
    // glDisable(GL_DEPTH_TEST);
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrthof(0,1 , 0, 1, -1, 1);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    // Set texture parameters
    glBindTexture(GL_TEXTURE_2D, texture.iID);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter ? GL_LINEAR : GL_NEAREST);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST);

    // Draw the textured quad
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glTexCoordPointer( 2, GL_BYTE, 0, texCoords );

    glVertexPointer( 2, GL_FLOAT, 0, vertices );

    glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
    glDrawElements( GL_TRIANGLE_STRIP,6*2 , GL_UNSIGNED_SHORT, indices );

    glMatrixMode( GL_PROJECTION );
    glPopMatrix();
    glMatrixMode( GL_MODELVIEW);


    where vertices is the array as below

    GLfloat vertices[ ]=
    {

    0.75, 0.05,
    0.95, 0.05,
    0.75, 0.25,
    0.95, 0.25

    };

    some png images are being loaded perfectly but some png images leaves white color and some images are sliced on being loaded. is there any problem with image size ??

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    31

    Re: png image loading problem ,using orthographic projec

    i am working on symbian^3

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    png image loading problem in symbian 3

    i am trying to load png image on screen using orthographic projection using code given below

    GLubyte texCoords[] =
    {
    0, 1,
    1, 1,
    0, 0,
    1, 0
    };

    GLushort indices[]={
    0,1,2,0,1,2,
    1,3,2,1,3,2
    };


    // Set orthogonal projection
    // glDisable(GL_DEPTH_TEST);
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrthof(0,1 , 0, 1, -1, 1);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    // Set texture parameters
    glBindTexture(GL_TEXTURE_2D, texture.iID);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter ? GL_LINEAR : GL_NEAREST);
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST);

    // Draw the textured quad
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glTexCoordPointer( 2, GL_BYTE, 0, texCoords );

    glVertexPointer( 2, GL_FLOAT, 0, vertices );

    glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
    glDrawElements( GL_TRIANGLE_STRIP,6*2 , GL_UNSIGNED_SHORT, indices );

    glMatrixMode( GL_PROJECTION );
    glPopMatrix();
    glMatrixMode( GL_MODELVIEW);


    where vertices is the array as below

    GLfloat vertices[ ]=
    {

    0.75, 0.05,
    0.95, 0.05,
    0.75, 0.25,
    0.95, 0.25

    };

    some png images are being loaded perfectly but some png images leave white color and some images are sliced on being loaded. is there any problem with image size ??

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: png image loading problem in symbian 3

    I love clones. Threads are merged now.

  6. #6
    Registered User
    Join Date
    Oct 2010
    Posts
    31

    Re: Picture slicing

    sir

    do you have any idea whats the problem ??

    thanks

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Picture slicing

    Not really. I just noticed the two identical piece of code.

    Have you checked http://wiki.forum.nokia.com/index.ph...emory_handling? Running out of memory may be a reason for having partial textures.

  8. #8
    Registered User
    Join Date
    Oct 2010
    Posts
    31

    Re: Picture slicing

    The behaviour of the same image(its a text written image) is differing with its size...i mean that the slicing of image takes place with say 97 by 19 size but doesnot happen with 148 by 35,and then the 148 by 35 image is further facing another problem--its not transparent even though it is png format.

  9. #9
    Registered User
    Join Date
    Oct 2010
    Posts
    31

    Re: Picture slicing

    i have put around 35-40 images . is it because of number of images , the images are not being drawn properly on screen ??

  10. #10
    Registered User
    Join Date
    Jun 2009
    Posts
    3

    loading bmp images of small resolution in symbian 3

    I am able to load bmp images of 256 by 256 resolution,,but when i load a bmp image of smaller resolution say 97 by 19,slicing of the image takes place. How to load the smaller images?

Similar Threads

  1. Dynamic loading of images in flash
    By juhauta in forum [Archived] Flash Lite on Nokia Devices
    Replies: 4
    Last Post: 2010-09-18, 19:26
  2. Code for implementing images in all Resolution
    By jameskittu in forum Symbian
    Replies: 10
    Last Post: 2009-10-30, 14:37
  3. Problem loading Images in 6600
    By inverse in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2006-03-30, 15:32
  4. Loading BMP file
    By Paticlicue in forum Symbian
    Replies: 2
    Last Post: 2004-04-17, 11:03
  5. What is the format of bmp image in Symbian?
    By deepakgmi in forum Symbian
    Replies: 1
    Last Post: 2004-01-28, 14:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×