Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User Starbucks's Avatar
    Join Date
    Jun 2009
    Posts
    3
    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 rocksvick's Avatar
    Join Date
    Oct 2010
    Posts
    31
    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 rocksvick's Avatar
    Join Date
    Oct 2010
    Posts
    31
    i am working on symbian^3

  4. #4
    Registered User Starbucks's Avatar
    Join Date
    Jun 2009
    Posts
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    I love clones. Threads are merged now.

  6. #6
    Registered User rocksvick's Avatar
    Join Date
    Oct 2010
    Posts
    31
    sir

    do you have any idea whats the problem ??

    thanks

  7. #7
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    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 rocksvick's Avatar
    Join Date
    Oct 2010
    Posts
    31
    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 rocksvick's Avatar
    Join Date
    Oct 2010
    Posts
    31
    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 Starbucks's Avatar
    Join Date
    Jun 2009
    Posts
    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 C++
    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 C++
    Replies: 2
    Last Post: 2004-04-17, 11:03
  5. What is the format of bmp image in Symbian?
    By deepakgmi in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved