Jump to content

ParaToxic

Members
  • Posts

    425
  • Joined

  • Last visited

Everything posted by ParaToxic

  1. By the way the problem is solved but I think I try to explane it again. When you write PivotRotation += mx/15.0; the Camera rotate to slow or a user will make it more intensive and put the value for exaple to PivotRotation += mx/5.0. So I have the same problem as before,because if the pivot rotate ,the camera doesn't follow directly ,and when you rotate it to fast for example the pivot angle is 350° and the Cameraangle still 70° ,the camera will turn back ,because its faster to turn the other way.
  2. Ok thanks for trying The problem with the rotation is ,that I TFormPoint and when the pivot the rotates to fast the camera doesn't follow ,so when the angle of the pivot is for example 350 ° and the Camera has still 90° than the Camera turns back the other way. See : Character.exe (Only the exe ,you have to download the zip before and copy that) Ok I think the problem is solved because I made it a little bit more faster and set a min,max to it. Character2.exe
  3. Have you tried to create a TBuffer and set with SetBufferColor (or SetColorBuffer actually i don't know) and set Buffer?
  4. Hello folks, yesterday I wrote my little control for a 3rd person game and I wanted to ask whether it is good or whether I could improve something. Thanks
  5. Yes but it isn't realy a Solution because it turns slower ,but if the user put the mouse intensitiv higher the rotation collaps again.
  6. Thanks for the Code but I going to take my because it behaves differently. I think I going to ask something else. I have here the following code,but when the Pivot rotates to fast(you rotate it with the mouse) it "estimate" because of the smoothing.But I need this smoothing because I think it looks very good just this rotation problem is a problem. Maybe somebody can tell me how to fix that,maybe with a "extern" Positioncoordinates for the rotation. mx = MouseX() - GraphicsWidth()/2.0; my = MouseY() - GraphicsHeight()/2.0; PivotRotation.X += my; PivotRotation.Y -= mx; MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); RotateEntity(MiddlePivot,Vec3(PivotRotation.X,PivotRotation.Y/10.0,0)); PointEntity(CameraPivot,MiddlePivot); PivotRotation.X = Curve(max(PivotRotation.X,-20.0),PivotRotation.X,2.0); PivotRotation.X = Curve(min(PivotRotation.X,23.0),PivotRotation.X,2.0); MoveEntity(CameraPivot,Vec3(TFormPoint(Vec3(0,1,-3),MiddlePivot,CameraPivot).X/40.0,TFormPoint(Vec3(0,1,-3),MiddlePivot,CameraPivot).Y/40.0,TFormPoint(Vec3(0,1,-3),MiddlePivot,CameraPivot).Z/40.0)); PositionEntity(MiddlePivot,Vec3(EntityPosition(Controller0).X,EntityPosition(Controller0).Y + 1.6,EntityPosition(Controller0).Z));
  7. I would like to position the camera around the Character with the angle value. So I have only the Angle ,no Pivots.The Camera have to turn around the Character with the angle value. EDIT: Better I tell you what I would do. I made a easy controll with the following commands: PositionEntity(MiddlePivot,Vec3(EntityPosition(Controller0).X,EntityPosition(Controller0).Y + 1.6,EntityPosition(Controller0).Z)); PointEntity(CameraPivot,MiddlePivot); MoveEntity(CameraPivot,Vec3(TFormPoint(Vec3(0,1,-3),MiddlePivot,CameraPivot).X/40.0,TFormPoint(Vec3(0,1,-3),MiddlePivot,CameraPivot).Y/40.0,TFormPoint(Vec3(0,1,-3),MiddlePivot,CameraPivot).Z/40.0)); The Problem is if I would turn the Camera , I have to turn the MiddlePivot ,but its a very smoothlie turning because. So I would like to add the rotation extern to CameraPivot (Camerapivot is actually the Camera self but it is in a protected class ,that i have to set the camera as a parent to the pivot).
  8. Hey, first a good new year I have a problem with my controll for a 3rd person game. I would like to rotate the camera ,which is directed with pointentity to the character,around the character with a radius of 3.5. But I need it to do with the position not with the rotation.But I don't know how to make that. I have only the angle in form of a float value and of curse the Character Mesh/Position... Here is my professional painted picture pic.bmp Thanks for help
  9. Thanks I worte that: CEGUI::System::getSingleton().injectMousePosition(MouseX(), MouseY()); if(MouseHit(1)) { CEGUI::System::getSingleton().injectMouseButtonClick(CEGUI::MouseButton::LeftButton); } else if(MouseHit(2)) { CEGUI::System::getSingleton().injectMouseButtonClick(CEGUI::MouseButton::RightButton); } else { CEGUI::System::getSingleton().injectMouseButtonClick(CEGUI::MouseButton::NoButton); } But it doesn't work Why?
  10. Hey guys I would like to use CEGUI and made a layout with the help of the tutorial.But now I going to make userinput. Until now I injected the Mouseposition with MouseX,Y from LE. But how can I inject Mouseclicks ans Keyboard input??? A code sample would be nice ;D Thanks
  11. Ok I made my first little Multiplayer Game Thank you for support and the great Tutorials ;D
  12. You can use the Collision Callback function of LE.In this function you can receive the force with which it collided. void _stdcall EntityCollisionCallback( TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed )
  13. I sent my structure successfully when I copy the client to an other PC in at my home it can't connect. In the Client properties I have my IP which is listed by the server under IP adresses at place 1. Maybe somebody can tell me why? I think the problem is the Socket IP,which is 127.0.0.1 ,so localhost.How can I solve that? Thanks and good night ;D
  14. Hello community, first big thank to Engineer Ken for the good Raknet tutorial. I would like to send an receive a little struct with the position and the rotation of an entity. I made it like this to send : struct Player { float a,b; }; //....... Player pl; pl.a = 12.0f; pl.b = 4.5f; //...... server->server->Send(reinterpret_cast<char*>(&pl),sizeof(pl), HIGH_PRIORITY, RELIABLE_ORDERED, 0, RakNet::UNASSIGNED_SYSTEM_ADDRESS, true); For the client i don't know how to convert the client->p->data to a created "Player" struct like pl2. Maybe somebody can tell me how to do that. Thanks ;D
  15. Thanks you with the Model it works well ;D
  16. Hey Guys,I would like to make a sound class for a FPS game and to check out on which type of ground the player is ,I would like to set to all Models a Key named "Surface" and a value like "Metal" or "Concrete".I set the Key ,but in C,in my Game it can't find this key or the value. Maybe somebody can help me ;D Little Map lue file: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) self.model:SetKey("Surface","Concrete") end and in C : else if(GetEntityKey(weapon->shootpick.entity,"Surface") == "Concrete") { PositionEntity(metal,EntityPosition(weapon->shootpick.entity)); PlaySource(concrete); } Thanks os much
  17. Thanks so much,it works very well. EDIT:How you defined the variable lastframebegin ? By the side i made a little class named Animation(Since the thread was already created),with all the variables and a Blending Function with the new sequenc and a smooth variable as parameters.For example your currently animation is sequenc 1 and you will change that to sequenc 2 with a smooth faktor of 0.01,you only call the Command BlendingAnim(2,0.01) and it smooth the blendingfaktor to 0.0 with the smooth value (0.01) ,set the new sequenc and go to 1.0. For somebody who needs it ;D Animation.h : #include <math.h> class Animation { public: Animation(); float framebegin; float frameend; float frame; float blend; float blendfaktor; bool blending; int sequenc; int newsequenc; float blendplus; float movement; void BlendingAnim(int s,float a); void Update(); }; Animation.cpp #include "Animation.h" Animation::Animation() { framebegin = 0.0f; frameend = 0.0f; frame = 0.0f; blend = 1.0f; blendfaktor = 0.0f; blending = false; sequenc = 1; newsequenc = sequenc; blendplus = 0.0f; movement = 1.0f; } void Animation::BlendingAnim(int s,float a) { Animation::blending = true; Animation::newsequenc = s; Animation::blendplus = a; } void Animation::void AnimOnce(int s,int olds) { } void Animation::Update() { Animation::blend +=Animation::blendfaktor; Animation::movement = 1.0f; if(Animation::blending == true) { if(Animation::sequenc != Animation::newsequenc && Animation::newsequenc != 0) { if(Animation::blend > 0.2) { Animation::blendfaktor = -Animation::blendplus; } else if (Animation::blend <= 0.2) { Animation::sequenc = Animation::newsequenc; Animation::blendfaktor = 0.0; } Animation::movement = 0.0f; } if(Animation::blend < 1.0 && Animation::sequenc == Animation::newsequenc ) { Animation::blendfaktor = Animation::blendplus; } else if(Animation::blend == 1.0 && Animation::sequenc == Animation::newsequenc) { Animation::blendfaktor = 0.0; Animation::newsequenc = 0; Animation::blending = false; } } }
  18. Hello Guys, I'm writting a FPS Game and I have a problem with the shoot Animation.The animation starts at frame 123 and ends at 142.But sometimes the animation doesn't start at frame 123. I think the problem is the fmodf command,but i don't know how i can solve that. Code : if(MouseHit(1)) weapon->shoot = true; if(weapon->shoot) { if(weapon->sequenc != weapon->WEAPON_SHOOT) { weapon->sequenc = weapon->WEAPON_SHOOT; } if(weapon->frame > 141) { weapon->shoottimer = 0; weapon->shoot = false; } } else { weapon->sequenc = weapon->WEAPON_IDLE; } and WEAPON_SHOOT define framebegin and frameend and set frame to framebegin: case Weapon::WEAPON_SHOOT: weapon->framebegin = 123; weapon->frameend = 142; weapon->frame = weapon->framebegin; break; and Animate : weapon->frame=AppTime()/40.0; weapon->frame=fmodf(weapon->frame,weapon->frameend-weapon->framebegin)+weapon->framebegin; Animate(weapon->model,weapon->frame,1.0,0,true); Thank you for help
  19. Ok but i can't get the Source because i haven't a lisence for it.
  20. No i don't use Framework,because its a little bit slowly and i can't include/load my own shaders.
  21. unfortunately i haven't an effect.I used the Tutorial "Postprocessing effects" but nothing is going on. Maybe somebody have a working example? Thanks
  22. Hello i would like to include the DOF shader to my project.When i load the Shader and set the Uniforms dofnerrange and doffarrange in the logfile stand that this Uniforms don't exist in the shader. Please help me. TShader dof=LoadShader("abstract::postfilter.vert","abstract::postfilter_dof.frag"); SetShaderVec2(dof,"dofnearrange",Vec2(10,15)); SetShaderVec2(dof,"doffarrange",Vec2(25,30)); and in the logfile stand: Warning: Uniform "dofnearrange" does not exist in shader. Warning: Uniform "doffarrange" does not exist in shader. What can i do?
  23. Thanks i tested it with the GetEntityKey ,but it doesn't work Here is the Code(converted to C++ from BlitzMax ) inline TBody GetMeshBody(TEntity mesh) { while(mesh != NULL) { if(GetEntityKey(mesh,"class") == "Body" || GetEntityKey(mesh,"class") == "Model") { return TBody(mesh); } mesh = GetParent(mesh); } } Thanks
×
×
  • Create New...