Jump to content

VeTaL

Members
  • Posts

    1,272
  • Joined

  • Last visited

Posts posted by VeTaL

  1. For now, i'm using 2 GUIs:

     

    1. ImGui (taken from raycast lib, and, to be correct, from Chris Paulson's Game )

    pros: its extremely simple, fast and code-driven.

    negs: it doesnt support skins, so it cant be end-user UI

    add: in combination with _raise/_event system (i tried to find, where i got it, but wasn't scusessed), it makes creation of debug panels extremely simple:

    1) its needed to inherit from GameObject: PlayerManager : public GameObject

    2) its needed to define 3 virtual functions

    virtual void UpdateEvent( float gameLoopTime);
    virtual void RenderEvent( float gameLoopTime);		
    virtual void RenderGuiEvent( float gameLoopTime);
    

    3) its needed to define RenderGuiEvent, which would be called every frame while drawing gui

    void PlayerManager::RenderGuiEvent( float gameLoopTime )
    {
    imguiBeginScrollArea("Player debug",
    	800, 10, 200, 200, &_debugScroll); 
    
    if (_controller)
    {
    	_playerPos = EntityPosition(_controller);
    	sprintf(_debugBuf, "playerX: %f", _playerPos.X );
    	imguiValue( _debugBuf );
    	sprintf(_debugBuf, "playerY: %f", _playerPos.Y );
    	imguiValue( _debugBuf );
    	sprintf(_debugBuf, "playerZ: %f", _playerPos.Z );
    	imguiValue( _debugBuf );
    	imguiSeparator();
    }	
    
    imguiEndScrollArea();	
    }
    

    and thats all!

     

    2. CeGui (i already had realization, but also nice tutorial was found here)

    pros: it supports skins and layout editor

    cons: its not so simple and flexible, it contains its own realisation of XML-parser, input and a lot of garbage

    add: after some additional work (well, you can just close your eyes at the structure of CEGUI and use it as "black box"), you can get nice UI for end-user.

     

    What are you thinking about it?

  2. The problem is that i cant find linking between light and shader.

     

    So, i created copy of Leadwerks Engine SDK\Models\Entities\Light\Point\ and called it Leadwerks Engine SDK\Models\Entities\Light\PointArea\

    then i renamed all files into light_pointArea

     

    now i'm searching for linking with pointlight.frag (i want to create pointlightarea.frag), but total commander says that there is no text "pointlight.frag" in folder Leadwerks Engine SDK\Models\Entities\

  3. Just wanted to add own 5 cents.

    In old Gamestudio magazine, it was said that there are three types of weapon:

    - raytrace (crossbow in Half-life with zoom)

    - physic bullet (crossbow in Half-life without zoom, mashine gun and so on)

    - grenades (you know, what i mean :) ) - actually, this is physic bullet with huge mass and low speed

     

    So its for you to chose, which solution suits you best

  4. Okay, attaching model to bone is solved (sword, shield and so on), but what about attaching body armor/helmet?

     

    1) About armor: looking like animator should create a speshial bone, which should indicate body rotation. i'm afraid that position of person's shoulder will differ from position of armor's shoulder.

    2) About helmet (same for gloves and so on): as he is attaching on the head, the head is not visible (or hand in case with gloves). Wouldnt it be a waste of polygons?

     

    Or its better to create separate models and just cnahge "head" -> "helmet with face", "hand" -> "glove" ?

  5. 2 Flexman:

    I used weapon from here http://www.leadwerks.com/werkspace/files/file/214-2-medieval-weapons/

    macklebee is right:

    //The origin was in the middle of the blade, instead of at the middle of the handle.

     

    The main idea of delta-movement and delta-rotation was in correction.. but as you said that

    1) I changed the origin and orientation of the sword, parented it to the hand, positioned and rotated as needed, and ran the animations and it worked just fine.

    2) I guess I am missing the issue here. I can parent a sword to the crawler's hand, then set the rotation and position as needed in the un-animated state. Then when I turn on the animation, the sword follows the hand automatically.

    3) If i set the parent of a model or a mesh, it will automatically take the scale of the parent. So if the parent is being scaled by .5, then the child model/mesh would have to scaled by 2 to keep it the original size. Scaling a child model/mesh has no effect of the parent.

    this is great information to sum up the most number of attaching questions.

     

    PS: but i'm missing nice-working Parenting, it should be more productive :D

  6. Second test:

    SetEntityMatrix(sword,GetEntityMatrix(FindChild(mi1->GetModel(),"Bip01 R Hand")));
    

     

    this works fine, no need in 3 points... but i wish parenting get work: while attaching there is need in delta-position

    post-648-0-67029200-1309096590_thumb.png

    post-648-0-74296300-1309096604_thumb.png

     

    So, now i will need to add delta-matrix to sword's matrix every frame... if parenting would work as expected, i will need to add delta position only once, while parenting

  7. I decied to use not "division of the segment in a given ratio", but equotion

    X = (1-A) * X1 + A * X2, where A comes from 0 to 1

     

    post-648-0-10101300-1309094914_thumb.png

    post-648-0-79004800-1309094927_thumb.png

    post-648-0-65756400-1309094934_thumb.png

     

    This works, but no instancing: looking like i really need to find someone, who knows shaders well :)

  8. Okay, i know that the best way of doing this is shader, but....

     

    I have model of fat and thin face... now i want to get a new model: i get every vertex of first model, then from second model, got an equation of "division of the segment in a given ratio" and a coefficient (A).

     

    if A = 0 then each vertex of new face is on the place of vertex from first face (they are similar)

    if A = 0,5 then i have my own face - between first and second

    if A = 1 then my face is similar to second face

     

    The question is: do anybody work on this before using Leadwerks? Is this idea effective?

    And what about instancing: if i would move one vertex of instanced model, wouldnt all other models change?

  9. But honestly, i think attaching should be in next way:

    we're taking vertex 1 on the hand and placing sword there.

    then we're taking vertex 2, make vector and align word with that vector

    at last, we're taking vertex 3 to create third point, which would fix our sword in all 3 dimensions

    post-648-0-31126800-1308930082_thumb.jpg

    post-648-0-54540000-1308930086_thumb.jpg

×
×
  • Create New...