Тема: Blitz3D engine
Показать сообщение отдельно
Старый 08.11.2007, 23:27   #117
XenuS
Нуждающийся
 
Регистрация: 31.07.2007
Сообщений: 89
Написано одно полезное сообщение
Re: Blitz3D engine

как и было обещано=)))) 10к кубиков.....фрустум включен....
в архиве лежат ехе и блица и B3Dengine...просьба отписаться=))
у меня:
мой двиг: 65-70 ФПС
блиц 3Д: 18-19 ФПС
(сам не знаю, отчего такая разница )
для примера я взял тоже кубики, как HolyDel=))
а, и еще....выход из моего двига пока Alt+F4...
код движка:
#include "Blitz3D.h"

#define M 10000

xFont *font;
xTexture *tex;
xCube c[M];

float fps;
int oif;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    SeedRnd(Millisecs());

    xDevice *device;
    xFlatDevice *flatDevice;
    xVolumeDevice *volumeDevice;

    device=new xDevice;
    flatDevice=new xFlatDevice;
    volumeDevice=new xVolumeDevice;
    font=new xFont;
    tex=new xTexture;

    device->createDevice(1024,768,32,true);
    device->setWindowTitle("~XenuS~ Soft engine (Blitz3D engine)");

    font->loadFont("Monotype Corsiva",36,0,1,0);
    flatDevice->setFont(font);

    tex->loadTexture("texture.bmp");
    tex->genTexture();

    for (int i=0;i<M;i++)
    {
        c[i].setTexture(tex);
        c[i].setPosition(Rand(-50,50),Rand(-50,50),Rand(-50,50));
        c[i].setRotation(Rand(0,360),Rand(0,360),Rand(0,360));
        volumeDevice->addMesh(c[i]);
        volumeDevice->applyMeshChanges(c[i]);
    }

    while (device->run())
    {
        device->updateDevice();
        device->getSystemEvents();

        for (int i=0;i<M;i++)
        {
            c[i].turn(0.1,0.2,0.3);
            c[i].move(0,0,0.1);
            volumeDevice->applyMeshChanges(c[i]);
        }

        volumeDevice->renderWorld();

        flatDevice->setXY(30,90);
        flatDevice->setColor(1,0,0);
        flatDevice->printText("FPS: %3.1f",fps);

        //flatDevice->setXY(30,210);
        //flatDevice->printText("Objects in frustum: %d",oif);

        volumeDevice->flip();
    
        fps=getFPS();
        //oif=volumeDevice->getObjectsInFrustum();
    }
    return 0;
}
код блица
Graphics3D 1024,768,32,1
SetBuffer BackBuffer ()

Lastfps#=0;
fps#=0;
time#=0
curtime#=0

font=LoadFont ("Monotype Corsiva",36,0,1,0)
SetFont font

Const N=10000

tex=LoadTexture("texture.bmp")

Dim c(N)
For i=1 To N
    c(i)=CreateCube()
    PositionEntity c(i),Rand(-50,50),Rand(-50,50),Rand(-50,50)
    RotateEntity c(i),Rand(0,360),Rand(0,360),Rand(0,360)
    EntityTexture c(i),tex
Next

cam=CreateCamera()

Repeat

    For i=1 To N
        TurnEntity c(i),0.1,0.2,0.3
        MoveEntity c(i),0,0,0.1
    Next 

    RenderWorld
    curtime#=MilliSecs()
    fps#=fps#+1
    If curtime#-time#>=1000
        Lastfps#=fps#
        fps=0
        time#=curtime#
    EndIf
    Color 255,0,0
    Text 30,90,"FPS: "+Lastfps#
    Flip
Until KeyHit(1)
End
(Offline)
 
Ответить с цитированием