Jump to content

ParaToxic

Members
  • Posts

    425
  • Joined

  • Last visited

Posts posted by ParaToxic

  1. I think it would be better to use CPU technologies like 3DNow or SSE 4 for calculation with Matrix ,Vectors and float calculation.This technologies works in Assambler and calculate floats in the FPU 16 times faster,as in C++ normal math.

  2. So i have a little example.Maybe somebody can told me why it is wrong.

     

    #include "engine.h"
    int main(int argc, char** argv)
    {
    Initialize();
    
    Graphics(800,600);
    
    TCamera cam=CreateCamera();
    PositionEntity(cam,Vec3(0,2,-10));
    Collisions(1,2,true);
    
    TModel scene=LoadModel("scene.gmf");
    
    EntityType(scene,2);
    
    TLight light=CreatePointLight();
    PositionEntity(light,Vec3(0,5,0));
    
    TBuffer buffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
    
    TController player=CreateController();
    SetBodyMass(player,6);
    EntityType(player,1);
    
    
    
    TVec3 point1=Vec3(0,0,0);
    TVec3 point2=Vec3(0,0,0);
    TVec3 a=Vec3(0,0,0);
    TVec3 b=Vec3(0,0,0);
    TPick pick;
    
    
    float move=0.0;
    float strafe=0.0;
    TVec3 camrotation=Vec3(0);
    float mx=0;
    float my=0;
    HideMouse();
    MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    
    while(!KeyHit(KEY_ESCAPE)) {
    
    mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
    my=Curve(MouseY()-GraphicsHeight()/2,my,6);
    MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    camrotation.X=camrotation.X+my/10.0;
    camrotation.Y=camrotation.Y-mx/10.0;
    RotateEntity(cam,camrotation);
    
    move=KeyDown(KEY_W)-KeyDown(KEY_S);
    strafe=KeyDown(KEY_D)-KeyDown(KEY_A);
    
    UpdateController(player,camrotation.Y,move,strafe);
    
    UpdateWorld();
    
    TVec3 playerpos=EntityPosition(player);
    TVec3 camerapos=EntityPosition(cam);
    camerapos.Y=Curve(playerpos.Y+1.75,camerapos.Y,2.0);
    camerapos=Vec3(playerpos.X,camerapos.Y,playerpos.Z);
    PositionEntity(cam,camerapos);
    
    
    point1=EntityPosition(cam);
    point2=Vec3(0,0,4);
    point2=TFormVector(point2,cam,0);
    
    if(LinePick(&pick,point1,point2,0,0))
    {
            a=CameraUnproject(cam,point1);
            b=CameraUnproject(cam,Vec3(pick.X,pick.Y,pick.Z));
    }
    
    
    SetBuffer(buffer);
    RenderWorld();
    SetBuffer(BackBuffer());
    RenderLights(buffer);
    
    DrawLine(a.X,a.Y,b.X,a.Y);
    Flip();
    }
    return Terminate();
    }

     

    Thank you for advanced

  3. Hello,i try to make a bullet class with Raycasting.I made a point1 at the player position and point2 like:

    point2=Vec3(0,0,30);
    point2=TFormVector(point2,cam,NULL);
    
    LinePick(&pick,point1,point2);
    

     

    this,but when i check the values of point2,its wrong.

    How can i solve this problem?

     

    Thank you

  4. Hello,i have a little problem here.I don`t know why,but i created the first animated figure in Cinema 4D with bones(not converting joints to bones) and exported that into fbx.Than i converted it to gmf and added the cobblestones.mat file to

    :

    texture0="abstract::cobblestones.dds"
    texture1="abstract::cobblestonesdot3.dds"
    
    shader="abstract::mesh_diffuse_bumpmap_skin.vert","abstract::mesh_diffuse_bumpmap_specular.frag"
    shadowshader="abstract::mesh_shadow_skin.vert"

     

    ,because i had the same texture in Cinema 4D.So now the bones move,but not the Body.It seems to look ,that the material file have no skin shader,but it does...

     

    Can me help somebody?

  5. Ok thats right now:D

     

    But i have one Question.I have created a host,peer and a Packet where i write an integer 4 in.So now in the main loop i will read a integer ,the other netuser have sended to my ip.But in the Command ReadLine oder other Read... you need the Objekt TStream,which don`t exist.I mean the Lib doesen`t have any commands for this objekt,so how can i read the message the other netuser broadcasted?

  6. Hey , i have searched for the error in the Netwerks Lib in LEadwerks.I Think lots of people in this forum want netwerk connecting in there games.

     

    Josh: The Command in the netwerks.c (ExitFunc make a Linking error),so please delete the codeline #ifndef LEADWERKS_ENGINE_NETWERKS and #endif LEADWERKS...

    Then i would works :)

     

    I hope iam not the only one with this error and it would helps other.

     

    Thanks

  7. Hey Guys , i want to chage in our little FPS Game the bullet as Bodies to Raycasting as in the LE Editor.But somehow it does not work ,to pick Bodies with CameraPick und Add Force to them.

     

    I have written :

     

     if(CameraPick( &pick,cam,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,1000),0))
      {
      AddBodyForce(pick.entity,Vec3(0,0,1));  //That is only for testing
      }
    

     

    and i become a error,when i shoot to a oildrum.

    Why is that so?

    Thank you

  8. Hey guys,we have here a problem with a animation from Cinema 4D.A Colleague have made a gun and a animation with Joints,but when you export that into FBX and convert it to gmf,the animation plays,but the hands(that are rigged and animatet) don`t move as as they should.

     

    It would be fine if you might say me how to do it properly.

     

    File was added.

     

    Thanks

    Gun.rar

×
×
  • Create New...