physics

Computing tensor of Inertia in 2D

谁说我不能喝 提交于 2020-01-25 22:18:34
问题 I'm researching how to find the inertia for a 2D shape. The contour of this shape is meshed with several points, the x and y coordinate of each point is already known. I know the expression of Ixx , Iyy and Ixy but the body has no mass. How do I proceed? 回答1: For whatever shape you have, you need to split it into triangles and handle each triangle separately. Then in the end combined the results using the following rules Overall % Combined total area of all triangles total_area = SUM( area(i)

Cocos2dx - setVelocity works differently on other devices with same resolution

こ雲淡風輕ζ 提交于 2020-01-25 20:25:41
问题 I'm dying with physics , i've tried to use setVelocity however i got slightly different result from different devices. I've tested on iPhone 5 (on simulator) and iPhone 6 (real device) The Director::getInstance()->getOpenGLView()->getFrameSize() returns both devices is 640x1136 pixels But i see they have different result after the animation , its about 2-5 pixels. I really don't know why. I'm making a multiple player game so i need exactly same coordinate of objects on every devices. Does

Prevent force-dragging bodies through other bodies with MatterJS

自古美人都是妖i 提交于 2020-01-21 01:31:31
问题 I'm using MatterJs for a physics based game and have not found a solution for the problem of preventing bodies being force-dragged by the mouse through other bodies. If you drag a body into another body, the body being dragged can force itself into and through the other body. I'm looking for a reliable way to prevent them from intersecting. You can observe this effect in any MatterJS demo by selecting a body with the mouse, and trying to force it through another body. Here is a typical

THREE.js - moving a 3D ball with a rotation

我们两清 提交于 2020-01-15 06:33:29
问题 I'm new to THREE.js and with a very poor knowledge in physics - but I am trying to build a football game engine (viewed from top) and right now I'm struggling with the movement of the ball. when trying to move the ball from side to side, the rotation is always facing one direction and I dont understand how to make this rotate in the direction its moving at. Ive added a simple code showing this issue. your help is much appreciated. /* * * SET UP MOTION PARAMS * */ var degrees = 10; var power =

Python physics library? [closed]

╄→гoц情女王★ 提交于 2020-01-13 08:31:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Are there any good up-to-date physics libraries for Python that are for Linux? I'm just getting into Python using PyGame, but PyGame's lack of a physics library isn't cool. I spent about two hours trying to find a good physics library but it's like trying to grab oil; I can't seem to do it. I barely need a

Python physics library? [closed]

和自甴很熟 提交于 2020-01-13 08:31:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Are there any good up-to-date physics libraries for Python that are for Linux? I'm just getting into Python using PyGame, but PyGame's lack of a physics library isn't cool. I spent about two hours trying to find a good physics library but it's like trying to grab oil; I can't seem to do it. I barely need a

2D Elastic Ball Collision Physics

为君一笑 提交于 2020-01-12 16:10:00
问题 I am making a program that involves elastic ball physics. I have worked out all of the maths for collision against walls and stationary objects, but I cannot figure out what happens when two moving balls collide. I have mass and velocity (x and y velocity to be exact, but velocity of each ball and their direction will do) and would like the formulae for those. Remember - this is a perfectly elastic collision - so no spinning balls, etc. 回答1: This wikipedia article provides a formula to

2D Elastic Ball Collision Physics

这一生的挚爱 提交于 2020-01-12 16:07:14
问题 I am making a program that involves elastic ball physics. I have worked out all of the maths for collision against walls and stationary objects, but I cannot figure out what happens when two moving balls collide. I have mass and velocity (x and y velocity to be exact, but velocity of each ball and their direction will do) and would like the formulae for those. Remember - this is a perfectly elastic collision - so no spinning balls, etc. 回答1: This wikipedia article provides a formula to

Damping Effect of Spring-Mass System (or is this ElasticEase?)

微笑、不失礼 提交于 2020-01-12 06:59:11
问题 I'm trying to emulate an animation effect in code (almost any language would do as it appears to be math rather than language). Essentially, it is the emulation of a mass-spring system. I've been looking at WPF/Silverlight's ElasticEase and this appears to be pretty close to what I'm looking for, but not quite. First of all, here's what I'm looking for - an object, travelling a certain number of seconds, hitting a location and immediately slowing down to ocsillate for a certain number of

What are good libraries for creating a python program for (visually appealing) 3D physics simulations/visualizations?

时光总嘲笑我的痴心妄想 提交于 2020-01-12 05:37:05
问题 What are good libraries for creating a python program for (visually appealing) 3D physics simulations/visualizations? I've looked at Vpython but the simulations I have seen look ugly, I want them to be visually appealing. It also looks like an old library. For 3D programming I've seen suggestions of using Panda3D and python-ogre but I'm not sure if it is really suited for exact simulations. Also, I would prefer a library that combines well with other libraries (E.g. pygame does not combine so