Results 1 to 2 of 2

Thread: Delphi: Colors of an object loaded with 3ds-loader

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2008
    Posts
    1

    Delphi: Colors of an object loaded with 3ds-loader

    Hello,

    I was looking for a simple 3ds-loader and found some on the web and I tried to use it with an example 3ds object of a plant but till now i was not able to show it in the right way. There are no external texture files with the 3ds-file but the 3ds editors display the plant in different colors. With the loader everything keeps white and with lightsources only gray shades.

    I can not figure out what is wrong and maybe it has something to do with an old openGL version. I don't want to use GLScene because i like to keep things simple and don't want to convert my project and base it on all these GLScene components.

    The Plant 3ds (m_plnt5_cut.mesh.gz) :
    Plant Page

    The simple Loader I use for Delphi:
    Simple 3DS loader

    The loader will display the plant in gray colors
    (In the source put Cz := -30; and change the 3ds filename..)

    If I load the plant for example in Milkshape 3D tool the pot is blue, the leaves are green and the earth in the pot is brown..

    How to show this with a simple loader??

    Thanks !!

  2. #2
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Delphi: Colors of an object loaded with 3ds-loader

    3ds file stores material chunks. material chunks store information related to the object it is assigned to. f.e. leaf would have green color for surface and maybe a texture assigned to it. first problem is to read material chunk out correctly and store it. seconds problem is to change material ( glMaterial ) values before drawing the corresponding object.

    psuedo code in C++ sorry:
    setMaterial(0); // leaf == 0
    renderSubset(0); // render leaf subset
    setMaterial(1); // pot == 1
    renderSubset(1; // render pot subset

Similar Threads

  1. Texture Object loaded with TexSubImage
    By jonathandup in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-23-2010, 02:43 AM
  2. viewing my loaded object
    By nick2price in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-19-2008, 03:36 AM
  3. Delphi object help
    By svg in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-07-2001, 07:56 AM
  4. looking for a 3ds obj loader in delphi for opengl
    By svg in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-28-2001, 04:09 AM
  5. delphi > looking for a 3ds loader in opengl
    By svg in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 08-20-2001, 03:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean