Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 65

Thread: GLXTreem

  1. #41

    GLXTreem

    downloaded and installed great, but some of the demos need to be updated. All that use lights, i changed most of them by hand:
    From:
    [pascal]
    GLXLighting1.Enable / Disable
    [/pascal]
    To:
    [pascal]
    GLXLighting1.EnableLighting / DisableLighting
    [/pascal]

    and the terrain demo needs some work, i get errors with these:
    [pascal]
    GLXTerrain1.Data.HeightData:=ImportHeightFromRaw(' heightmap.raw');
    GLXTerrain1.Data.LightData :=ImportLightFromBmp ('texturemap.bmp');
    [/pascal]
    The import functions no longer exists?!?

    beside from them its looking great

    will you place in support for Lightwave anytime?
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

  2. #42

    GLXTreem

    Well, i have changed from Enable to EnableLightning a couple of times now, just can't make up my mind =) The terrain error seems odd, they should be in GLXTerrain.pas but i have redone the terrain engine completly so that will be updated. And, yes i'm currently working on lightwave support, it will be done in the next release =) And there will also be some basic collision detection routines added.
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  3. #43

    GLXTreem

    Hello! I am Brazilian.

    I made a change in the routine DrawAdd, in GLXImageList.pas:

    //----------------------------------------------------------------------------
    procedure TGLXImageItem.DrawAdd(X, Y, PatternIndex: Integer; Alpha: Single);
    begin
    glEnable(GL_BLEND);
    glColor4f(1.0,1.0,1.0,Alpha);
    glBlendFunc(GL_SRC_ALPHA,GL_ONE);;
    Draw(X,Y, PatternIndex);
    glDisable(GL_BLEND);
    end;



    And to call the function:

    //----------------------------------------------------------------------------
    GLXImageList1.Items.Find('PacMan.bmp').DrawAdd(10, 10, 0, 0.3);

    The last parameter controls the transparency, of 0.0 (transparent) up to 1.0 (opaque).


    A simple, but very useful change (at least for me).

  4. #44

    GLXTreem

    Great work! Been w8ing to get into 3d for quite some time now,...

    If you keep adding fuctionality like collision detection and demos to GLX I'll almost certainly use it to make a simple game for a start. PacMan? =)

    Keep up the good work!
    What echoes in Eternity has been done in someone's life...

  5. #45

    GLXTreem

    The routine DrawRotate is not working together with StrechDraw. Then I altered the code of GLXImageList.pas:


    //---------------------------------------------------------------------------
    procedure TGLXImageItem.DrawRotate(X, Y, Width, Height, PatternIndex: Integer;
    CenterX, CenterY: Double; Angle: Integer);
    var Rect: TRect;
    RenderState: TGLXRenderState;
    begin

    glPushMatrix();
    glLoadIdentity();
    Rect.Left :=-Round( CenterX * PatternWidth );
    Rect.Top :=-Round( CenterY * PatternHeight);
    Rect.Right := Round((1-CenterX) * PatternWidth );
    Rect.Bottom:= Round((1-CenterY) * PatternHeight);
    glPopMatrix();

    RenderState:= GLXDraw.RenderState;
    GLXDraw.RenderState:=rs2D;
    glPushAttrib(GL_TEXTURE_BIT);
    glEnable(GL_TEXTURE_2D);
    Bind;

    glTranslate(X,Y,0);
    glRotate(Angle, 0,0,1);

    glBegin(GL_QUADS);
    with FPatterns[PatternIndex] do begin
    glTexCoord2f(Left , Bottom); glVertex2i(Rect.Left , Rect.Top);
    glTexCoord2f(Right, Bottom); glVertex2i(Rect.Right, Rect.Top);
    glTexCoord2f(Right, Top ); glVertex2i(Rect.Right, Rect.Bottom);
    glTexCoord2f(Left , Top ); glVertex2i(Rect.Left , Rect.Bottom);
    end;
    glEnd();
    glPopAttrib();
    GLXDraw.RenderState:=RenderState

    end;

  6. #46

    GLXTreem

    I am wanting to use that library in my game of ships, then I added more two routines that will be useful for me: Rotation Add and with Mask:


    //------------------------------------------------------------------------------
    procedure TGLXImageItem.DrawRotateAdd(X, Y, Width, Height, PatternIndex: Integer;
    CenterX, CenterY: Double; Angle: Integer; Alpha: Single);
    var Rect: TRect;
    RenderState: TGLXRenderState;
    begin

    glPushMatrix();
    glLoadIdentity();
    Rect.Left :=-Round( CenterX * PatternWidth );
    Rect.Top :=-Round( CenterY * PatternHeight);
    Rect.Right := Round((1-CenterX) * PatternWidth );
    Rect.Bottom:= Round((1-CenterY) * PatternHeight);
    glPopMatrix();

    glEnable(GL_BLEND);
    glColor4f(1.0,1.0,1.0,Alpha);
    glBlendFunc(GL_SRC_ALPHA,GL_ONE);;

    RenderState:= GLXDraw.RenderState;
    GLXDraw.RenderState:=rs2D;
    glPushAttrib(GL_TEXTURE_BIT);
    glEnable(GL_TEXTURE_2D);
    Bind;

    glTranslate(X,Y,0);
    glRotate (Angle, 0,0,1);

    glBegin(GL_QUADS);
    with FPatterns[PatternIndex] do begin
    glTexCoord2f(Left , Bottom); glVertex2i(Rect.Left , Rect.Top);
    glTexCoord2f(Right, Bottom); glVertex2i(Rect.Right, Rect.Top);
    glTexCoord2f(Right, Top ); glVertex2i(Rect.Right, Rect.Bottom);
    glTexCoord2f(Left , Top ); glVertex2i(Rect.Left , Rect.Bottom);
    end;
    glEnd();
    glPopAttrib();
    GLXDraw.RenderState:=RenderState;
    glDisable(GL_BLEND);

    end;


    //------------------------------------------------------------------------------
    procedure TGLXImageItem.DrawRotateMask(X, Y, Width, Height, PatternIndex: Integer; CenterX, CenterY: Double; Angle: Integer; Mask: TGLXImageItem);
    begin
    glPushAttrib(GL_DEPTH_BUFFER_BIT);
    glEnable(GL_BLEND);
    glDisable(GL_DEPTH_TEST);

    glBlendFunc(GL_DST_COLOR,GL_ZERO);
    Mask.DrawRotate(X,Y, Width, Height, PatternIndex, CenterX, CenterY, Angle);
    glBlendFunc(GL_ONE, GL_ONE);
    DrawRotate(X,Y, Width, Height, PatternIndex, CenterX, CenterY, Angle);

    glDisable(GL_BLEND);
    glPopAttrib();
    end;

    ----
    P.S.: I loved this library!

  7. #47

    GLXTreem

    Two routines, involving fonts, they needed to be modified in GLXFont.pas:

    //---------------------------------------------------------------------------
    procedure TextOutOutline(Base: glUint; X, Y, Z: Integer; Text : String);
    begin
    glPushAttrib(GL_DEPTH_BUFFER_BIT or GL_TEXTURE_BIT or GL_LIST_BIT);
    glEnable (GL_DEPTH_TEST);
    glEnable (GL_TEXTURE_2D);

    glPushMatrix();
    glTranslatef(X,Y,Z);

    glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
    glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
    glEnable(GL_TEXTURE_GEN_S);
    glEnable(GL_TEXTURE_GEN_T);

    glPushAttrib(GL_LIST_BIT);
    glListBase(Base);
    glCallLists(Length(text), GL_UNSIGNED_BYTE, PAnsiChar(Text));
    glPopMatrix();
    glPopAttrib();

    glDisable(GL_TEXTURE_GEN_S);
    glDisable(GL_TEXTURE_GEN_T);


    end;


    //---------------------------------------------------------------------------
    procedure TGLXFontItem.TextOut(X, Y, Z: Integer; Text: String);
    var RenderState: TGLXRenderState;
    begin
    if (Text = '') then Exit;
    SetCurrentColor;
    IF FFontType = ftSystem then begin
    RenderState:= GLXDraw.RenderState;
    GLXDraw.RenderState:=rs2D;
    TextOutSystem (Base, X,Y-Font.Height , Text);
    GLXDraw.RenderState:=RenderState
    end else
    IF FFontType = ftOutline then begin
    RenderState:= GLXDraw.RenderState;
    GLXDraw.RenderState:=rs3D;
    TextOutOutline(Base, X,Y ,Z, Text);
    GLXDraw.RenderState:=RenderState
    end;

    glColor3f(1.0, 1.0, 1.0);

    end;

  8. #48

    GLXTreem

    Thanks for the modifications, SuperEly I'll add them to the upcoming release.
    And for the font support, there's also a number of other things limiting the font component, the font sizes don't resize when the window is resized, just the raster position that is scaled, this makes it wery hard to get the font's where they should be. So my thoughts is to skip the system font support and remake it to bitmap fonts instead (textured ofcourse) wich doesn't have the mentioned problems.

    And BojZ, the component GLXColisionTester will also be included in the release. It has support for colisions between Spheres, cubes and points (not 100% accurate for cubes but close to).

    I also descided not to add support for lwo objects, (deep exploration and milkshape 3d will do the conversion between lwo and ms3d) the reason is among others this:

    http://home.clara.net/paulyg/tte.htm


    The Change log for the next release is currently:

    -GLXTerrain new uses multitexturing
    -Added GLXEnvironment with SkyBoxes and more
    -Added GLXCollisions for collision detection
    -Multitexture support in GLXImageList
    -Entity support in GLXQuake3BSP
    -New demo: MultiTexturing
    -Changed MessageBoxe's to exeptions

    As well as a bunc of minor changes and tweaks.

    What really would be needed is a tga loader / saver with the alpha channel, i havn't found any easy to use, singlefiled freeware version and the progress on the ownwritten one is going extreemly slow. Anyone has any suggestions ??
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  9. #49

    GLXTreem

    Quote Originally Posted by AndreasL
    What really would be needed is a tga loader / saver with the alpha channel, i havn't found any easy to use, singlefiled freeware version and the progress on the ownwritten one is going extreemly slow. Anyone has any suggestions ??
    The GraphicEx library supports TGA, along with many other formats. It is open source and can be found here.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  10. #50

    GLXTreem

    Quote Originally Posted by Useless Hacker
    Quote Originally Posted by AndreasL
    What really would be needed is a tga loader / saver with the alpha channel, i havn't found any easy to use, singlefiled freeware version and the progress on the ownwritten one is going extreemly slow. Anyone has any suggestions ??
    The GraphicEx library supports TGA, along with many other formats. It is open source and can be found here.
    Thank's it works really nice, now Targa files is supported by the imagelist also. What do you think of the font support ? How should it be implemented, scrap the system fonts and build nice 2D fon support instead ?? Please post your ideas here =)
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

Page 5 of 7 FirstFirst ... 34567 LastLast

Bookmarks

Posting Permissions

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