Jump to content

tipforeveryone

Members
  • Content Count

    362
  • Joined

  • Last visited

Everything posted by tipforeveryone

  1. It sound sweet, then please help me with a simple fomula or steps to archive my calculation
  2. Oh I see, Thanks for pointing it out. If there is one more vector (a) which have known Orange point position, and it is on the same plane with vector u and w (as figure image), and a new beta angle which = 1/2 * alpha angle will it be posible to calculate the Black position ?
  3. Thanks for you reply All of Red, Blue, Black are in 3D and alpha is not a constant Can you help me with a formula, it is bad that I can't remember these basic formulas for triangle calculation red:GetPosition(true) blue:GetPosition(true) u:Length() alpha black:GetPosition(true) = ???
  4. I am not really good at math, Can you show me how to solve this Known: Position of Red and Blue (in Vec3) Length of edge between Blue and Black, Alpha Angle (in Degree) I want to get the position of Black (in Vec3) Thanks
  5. You must use bones (and meshes parented to them as auto weight) to export animation. Export both mesh and its bones. Then applying shader which used for animation on materials of the mesh.
  6. Finally I found the solution for this problem. it is not related to Leadwerks, there was a process named "Rivet Networks Dynamic bandwidth manager" which running on my laptop. The process made CPU run at unstable rate which caused stutter problem.
  7. yesterday my Leadwerks was still normal, but today, I get this problem with FPS, anyone has any idea about which caused this ?
  8. Thanks Josh, I believe in the future of Leadwerks !
  9. Bullet Physic with gravity, now sniping is much more fun
  10. I am trying to build a Top view shooting game First I use Camera:Pick to get collided position by Mouse pointer to Terrain, everything ok, System:Print() can make output of collided position --set shooting point follow mouse cursor mousepos = window:GetMousePosition() mousePickInfo = PickInfo() if camera:Pick(mousepos.x,mousepos.y,mousePickInfo,0,true,Collision.LineOfSight) then shootingPoint:SetPosition(mousePickInfo.position) --shootingPoint is a pivot which I created in Script:Start() System:Print(mousePickInfo.position) end Then I create a ray from player position to mousePickInfo.position then there is problem, the ray can not collide some areas of terrain and return 0,0,0 position, a height map was imported to construct terrain bulletPickInfo = PickInfo() world:Pick( body:GetPosition(true), mousePickInfo.position, bulletPickInfo,0.2,true,Collision.LineOfSight ) I use a context:DrawLine to visualize the ray, and here the video, notice that when I move the mouse, sometime the red line changes its end point
  11. First time I make game for Tournament, it feelsย competitive, somehow :)

  12. I mean you can apply a material which uses emission shader only for that part of mesh (where is the light position) then use entity:GetSurface() to change the light's stages
  13. Use material with emission shader, only for that light
  14. you can add a specular map to your material, that will look better than just reducing specular color. Use photoshop to make that specular map from diffuse by black and white command, then adjust contrast.
  15. You can get the length of animation by using entity:GetAnimationLength() Then how to get the current frame of an animation, I want to play a sound in the middle of animation so that I need that. Please show me Thanks
  16. I dont feel any diffirence between these functions in final resuilt when applying to a camera. So there is any way to know when to use Zoom or FOV ?
  17. Maybe you should right-click on the viewport then check out RenderMode
  18. I have this problem on 4.6 sometimes, my suggestion is using stable 4.5 instead
  19. I use this for my weapon blocking (by wall) system, I think it will work with your camera You can calculate the distance between the pickInfo.position and the entity which you put start of Pick (Beam Point 1) then use the maximum range of your camera to player (self.defaultCameraRange) minus that, you get the distance between MaxRange to pickInfo.position (called self.collisionMinusRange) Because camera point its Z axis to player, so that you can use entity:Move(0,0,self.collisionMinusRange) In the meantime, Use camera:SetPosition(self.beamPoint2:GetPosition(true)) to keep you camera at the maxRange when not collided any obstacle Hope you can understand what I am trying to explain
  20. You can modify the code and make it work I think, because this function was used in my hand-made PlayerScript then I am not sure it will work on default AI / Player scripts of leadwerks.
  21. target in my function should be an entity, dont try it with Vec3() value
  22. I have a small function which can help you to define if an entity is inside a cone view of another entity. function CheckConeView(axis,entity,target,angle) local z,u if axis == "x" then z = Transform:Point(Vec3(1,0,0),entity,nil) elseif axis == "y" then z = Transform:Point(Vec3(0,1,0),entity,nil) elseif axis == "z" then z = Transform:Point(Vec3(0,0,1),entity,nil) end u = Transform:Point(target:GetPosition(true),nil,entity) z = Transform:Point(z,nil,entity) local targetAngle = Math:ACos(u:Dot(z)/(u:Length()*z:Length())) if targetAngle < angle/2 then return true else return false end end This should be made as global function, then you can use this as below function Script:PostRender() if CheckConeView("z",self.yourPlayerCamera,self.target,90) and self.targetInRange == true then --display health bar code end end hope this make your idea possible
  23. Anyone has an example of this shader usage ? I mean a collection of All texture maps which can combine together on an object. which texture slot should I put those textures into ? By the way, Is there any tutorial which shows me how to create parallax / roughness for leadwerks
ร—
ร—
  • Create New...