Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Posts posted by Canardia

  1. I read this on the Raydium website (a great engine to learn how to write engines btw), and I kinda understood for the first time how to use quaternions:

    2.27 void raydium_math_quaternion_multiply(float *q1, float *q2, float *result):

    Multiply two quaternions and fill the result with the resulting quaternion.

    Quite usefull for making rotations over quaternions.

    Here a list of common quaternions:

    W X Y Z

    1,0,0,0 Identity quaternion, no rotation

    0,1,0,0 180' turn around X axis

    0,0,1,0 180' turn around Y axis

    0,0,0,1 180' turn around Z axis

    sqrt(0.5),sqrt(0.5),0,0 90' rotation around X axis

    sqrt(0.5),0,sqrt(0.5),0 90' rotation around Y axis

    sqrt(0.5),0,0,sqrt(0.5) 90' rotation around Z axis

    sqrt(0.5),-sqrt(0.5),0,0 -90' rotation around X axis

    sqrt(0.5),0,-sqrt(0.5),0 -90' rotation around Y axis

    sqrt(0.5),0,0,-sqrt(0.5) -90' rotation around Z axis

    TODO: Those could be added like defines

  2. Actually the old Blender interface was far easier than of any other modeller.

     

    I tried parallelly to create the same objects in Blender, 3DSMax, Maya, etc..., and with Blender it was far easiest: just spacebar + create + shape (like cube), and with tab you switch between object and vertex modelling. That's basically all you need to create 3D models (and all the ad-hoc related and needed functions can be found by pressing spacebar).

     

    It's a shame that they ruined Blender with the 2.50 release, as now it's as uncomfortable to use as the other modellers out there. But I heard you can switch back to the old interface too, but I haven't found out yet how.

  3. Use Rar with -m5 packing, or 7-Zip. Both should make more than 2 times smaller files than WinZIP :)

    Both are also well known standards, so nobody can complain how to unpack it (basically you only need WinRar for unpacking anything, it unpacks also 7-Zip files).

  4. Example02.lua in the SDK can be used as the Lua template.

     

     

     

    C++ example (add engine.cpp):

    #include "engine.h"
    
    int main()
    {
    if( !Initialize() )
    	return 1;
    
    // Set graphics mode
    if( !Graphics(1024,768) )
    {
    	MessageBox( 0, "Failed to set graphics mode.", "Error", 0 );
    	return 1;
    }
    
    // Create framework object and set it to a global object so other scripts can access it
    TFramework fw = CreateFramework();
    if( fw == NULL )
    {
    	MessageBox( 0, "Failed to initialize engine.", "Error", 0 );
    	return 1;
    }
    
    // Set Lua framework object
    SetGlobalObject( "fw", fw );
    
    // Set Lua framework variable
    BP lua = GetLuaState();
    lua_pushobject( lua, fw );
    lua_setglobal( lua, "fw" );
    lua_pop( lua, 1 );
    
    // Get framework main camera
    TCamera camera = GetLayerCamera( GetFrameworkLayer(0) );
    PositionEntity( camera, Vec3(0,0,-2) );
    
    TMaterial material = LoadMaterial( "abstract::cobblestones.mat" );
    
    TMesh mesh = CreateCube();
    PaintEntity( mesh, material );
    
    TMesh ground = CreateCube();
    ScaleEntity( ground, Vec3(10,1,10) );
    PositionEntity( ground, Vec3(0,-2,0) );
    PaintEntity( ground, material );
    
    TLight light = CreateDirectionalLight();
    RotateEntity( light, Vec3(45,45,45) );
    
    while( !AppTerminate() )
    {
    	TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) );
    
    	UpdateFramework();
    	RenderFramework();
    
    	Flip( 0 );
    }
    
    return Terminate();
    }

     

     

     

    C++ LEO example (add leo.cpp, engine.cpp):

    #include "leo.h"
    using namespace LEO;
    
    int main()
    {
    // Set graphics mode
    Engine engine("Example - LEO with Framework",1024,768);
    
    if( !engine.IsValid() )
    {
    	MessageBox( 0, "Failed to set graphics mode.", "Error", 0 );
    	return 1;
    }
    
    // Create framework object and set it to a global object so other scripts can access it
    Framework fw;
    fw.Create();
    
    if( fw == NULL )
    {
    	MessageBox( 0, "Failed to initialize engine.", "Error", 0 );
    	return 1;
    }
    
    // Set Lua framework object
    engine.SetObject( "fw", fw );
    
    // Set Lua framework variable
    Lua lua;
    lua.Create();
    lua.PushObject( fw );
    lua.SetGlobal( "fw" );
    lua.Pop( 1 );
    
    // Get framework main camera
    fw.main.camera.SetPosition( Vec3(0,0,-2) );
    
    Material material( "abstract::cobblestones.mat" );
    
    Cube mesh( CREATENOW );
    mesh.Paint( material );
    
    Cube ground( CREATENOW );
    ground.Scale( Vec3(10,1,10) );
    ground.SetPosition( Vec3(0,-2,0) );
    ground.Paint( material );
    
    DirectionalLight light( CREATENOW );
    light.SetRotation( Vec3(45) );
    
    while( !engine.IsTerminated() )
    {
    	mesh.Turn( Vec3( AppSpeed()*0.5f ) );
    
    	fw.Update();
    	fw.Render();
    
    	engine.Flip( 0 );
    }
    
    return engine.Free();
    }

     

     

     

    C++ LEO with Framewerk example (add leo.cpp, engine.cpp, framework.cpp, layer.cpp, renderer.cpp):

    #include "leo.h"
    #include "framewerk.h"
    using namespace LEO;
    using namespace leadwerks;
    
    int main()
    {
    // Set graphics mode
    Engine engine("Example - LEO with Framewerk",1024,768);
    
    if( !engine.IsValid() )
    {
    	MessageBox( 0, "Failed to set graphics mode.", "Error", 0 );
    	return 1;
    }
    
    // Create framewerk object and set it to a global object so other scripts can access it
    Framewerk fw;
    
    if( !fw.Create() )
    {
    	MessageBox( 0, "Failed to initialize engine.", "Error", 0 );
    	return 1;
    }
    
    // Note! Lua is not supported when using Framewerk
    
    // Get framewerk main camera
    Camera camera( fw.GetMain().GetCamera() );
    camera.SetPosition( Vec3(0,0,-2) );
    
    Material material( "abstract::cobblestones.mat" );
    
    Cube mesh( CREATENOW );
    mesh.Paint( material );
    
    Cube ground( CREATENOW );
    ground.Scale( Vec3(10,1,10) );
    ground.SetPosition( Vec3(0,-2,0) );
    ground.Paint( material );
    
    DirectionalLight light( CREATENOW );
    light.SetRotation( Vec3(45) );
    
    while( !engine.IsTerminated() )
    {
    	mesh.Turn( Vec3( AppSpeed()*0.5f ) );
    
    	fw.Update();
    	fw.Render();
    
    	engine.Flip( 0 );
    }
    
    return engine.Free();
    }

     

     

     

    C++ GameLib example (add gamelib.cpp):

    #include "gamelib.h"
    
    int main()
    {
    Game game(CREATENOW);
    
    if( !game.engine.IsValid() )
    {
    	MessageBox( 0, "Failed to initialize engine.", "Error", 0 );
    	return 1;
    }
    
    // Set graphics mode
    game.Initialize(1024,768);
    
    // Get framework main camera
    game.scene.framewerk.main.camera.SetPosition( Vec3(0,0,-3) );
    
    Material material( "abstract::cobblestones.mat" );
    
    Cube mesh( CREATENOW );
    mesh.Paint( material );
    
    Cube ground( CREATENOW );
    ground.Scale( Vec3(10,1,10) );
    ground.SetPosition( Vec3(0,-2,0) );
    ground.Paint( material );
    
    DirectionalLight light( CREATENOW );
    light.SetRotation( Vec3(45) );
    
    while( !game.engine.IsTerminated() )
    {
    	mesh.Turn( Vec3( AppSpeed()*0.5f ) );
    
    	game.scene.Update();
    	game.scene.Render();
    
    	game.scene.Flip( 0 );
    }
    
    return game.Free();
    }

  5. You can also change the application runtime path with C++ code, so no cmd file is needed. That meaans you can also make a command with enables the engine to find DLL files in a specified folder.

  6. SetColor(Vec4(1, 1, 1, 1)) simply clears the changes you made using SetColor at the start of the 2D phase, no need to fetch the original colour and re-apply.

     

    I think you will find that Max2D functions interfere with some Leadwerks functions.

    If the color was originally red (for example in a flight sim with red-out effect active), then SetColor(Vec4(1)) would change it to white, so GetColor() is indeed a more professional approach.
  7. Leadwerks Engine is the best 3D engine for Virtual Reality Simulations and AAA games (like Crysis, Delta Force, Flight Simulator X, etc...).

     

    If you want to make only non-AAA games, you can use any engine which runs on the hardware your target audience has, or even just code directly without any engine.

  8. SetColor() affets deferred rendering, since the last render phase is done with DrawImage() which is affected by SetColor(). So with SetColor() you can color the whole screen with a certain color hue, including alpha transparency for opacity of the color.

  9. A much hard problem is if two players push a box in opposite directions.
    That used to work fine in the Chat17 client when I pushed oildrums with wh1sp3r in opposite directions. Both were pushing it with the same force, and in the end the oildrum stopped between us.
  10. When all clients run newton in precision mode, there shouldn't be any difference on the model positionings between clients. The server could sync the positions once every minute only!

    The only thing the server needs to do actively is to handle the player positions, so that all surrounding physics objects which are moved by the players get the same physics forces in each client. It shouldn't be depending too much on the controller either, as some games might use completely custom physics bodies for the players.

  11. Macs can run also WINE, which runs LE also fine, so they don't necessarily even need to boot to Windows, but can use their modern OSX environment. The last I checked only Editor had some problems with WINE, but that problem was also with other Windows programs which are using riched20.dll controls. They might have fixed that in WINE already, haven't checked for a while.

     

    Anyway, it doesn't affect games written with LE, only developing them. And you can also run VirtualBox on OSX, there you can run a real Windows XP environment within OSX, where also Editor works.

  12. Macs have their own position in the market. They are preferred by people who fall into Microsoft's suggestions to upgrade and patch and find nothing working after that. People who don't have time or interest to study how to get a PC working decently (needs XP, minimize services, etc...), just buy a Mac and find everything working.

     

    It's not so fast and modern as a PC in hardware means (in software it's actually even more advanced than a PC since it uses Unix V5), but it works without having to know anything much about computers. The difficulty to use a PC starts already with the purchase. Most PCs which are sold by marketing people as good and modern, are actually pure ****, and worse than some 3 year old high end machines.

     

    With Macs you are not fooled on the purchase; sure they cost a bit more (you have to pay for the brand), but they don't cost much more than a comparable PC (not those new **** PCs with built-in Intel video chips).

     

    Consoles are quite similar to Macs in that sense. They also don't have the latest hardware, and are aimed at computer illiterate people. For example CryENGINE 3 on consoles (XBOX, PS3), looks much worse than CryENGINE 2 on PCs. The console hardware is THAT outdated (which would mean over 3 years behind the PC hardware).

    CryTek itself said that they can't wait for the next version of consoles, as they already squeezed out everything from consoles with CryENGINE 3, and still had to gimp down the visuals to a year 2005 PC equivalent. The price of consoles is also higher than the of PCs, since you get a year 2005 PC for under 200€ (especially if you bought it back then).

  13. I guess the CalcBodyVelocity() and CalcBodyOmega() does not work accurately after all. At least I didn't get it to work with the Penumbra style picking up and floating models around very fast. I takes a while before the model is placed and rotated to the wanted position. If those functions would work accurately, I would need only one SetBodyForce() and SetBodyOmega() call to make the model be in the wanted position. Those functions would be needed also for networked physics, to interpolate the client's objects to the server's positions.

  14. - Loose leather clothing, partially self-improved for your needs, brown or black in color maybe. Leather gloves with fingers visible is a must to have cliché!

    - A leg or arm could be mechanically improved and/or stabilized since the original limb was injured (it's a dangerous world out there with all the rubble and sharp edges)

    - Some tools hanging from the clothes. You never know when you find some mechanical debris to harvest, or need to repair something

    - A knife is good to have in the leather boots

    - Somekind of powerful enough gun to protect yourself from wild animals, but why not also from raiders and plunderers

    - Maybe a pet walking with you can be helpful, as you don't want to be dependable on some friends all the time when you go somewhere, and going alone is taking unnecessary risks

     

    In short:

    http://www.horror-movies.ca/AdvHTML_Upload/mad-max-2.jpg

  15. Advanced artists wouldn't need CSG in Editor, as they can model much faster in their familiar modelling program. Other engines, like S2 have a seperate BSP modeller and a seperate map editor where you place models, but Editor could have the CSG module as a seperately sold add-on (like a DLL), which would be used by 3DWS6 also. For 3DWS users, the add-on could perhaps come also with 3DWS6, so they don't need to buy 3DWS6 and the add-on seperately.

  16. I may be way off here but calling any sort of engine command from C/C++, C# or LUA requires the DLL to be present in the same directory as the EXE. Thus you could never implement this as an engine command the way I see it.
    Like I said, DLLs work just like EXEs, they don't need to be in the same directory from where you are calling them, but they need to be in the path. It's a shame that Windows uses the current directory as a hack to add to the path, since on other OS, like OSX, Unix, AIX, Linux, BSD, etc... you can't even run an "exe" from the current directory unless it's in the path, but you need to specify the path from there to run the "exe", like ./mygame. It's also a security risk that Windows calls any exe from the current directory, that's why other OS don't do that.
  17. Using procedural C++ API, it would look like this:

    TFramework fw=CreateFramework();
    SetBloom(1);

    Using OOP C++ API it would look like his:

    Framework fw;
    fw.Create();
    fw.renderer.SetBloom(true);

    It will be also possible to do it like this in the OOP C++ API, but it's not implemented yet for the Framework class (for other classes it works):

    Framework fw(CREATENOW);
    fw.renderer.SetBloom(true);

×
×
  • Create New...