 Home
 » Viewing Profile: Reputation: lucadeltodesco
Banner advertising on our site currently available from just $5!
1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!
lucadeltodesco
Member Since 10 May 2006Offline Last Active Sep 07 2013 03:50 PM
Community Stats
 Group Members
 Active Posts 468
 Profile Views 4,090
 Submitted Links 0
 Member Title Member
 Age 24 years old
 Birthday March 15, 1991

Gender
Male

Location
London, UK

Interests
Rock Climbing, Programming
#4864606 Rigid body rotation and movement
Posted by lucadeltodesco on 22 September 2011  05:12 AM
#4850421 Predicting the 2D path of a rotating rocket?
Posted by lucadeltodesco on 17 August 2011  12:29 PM
a(t) = a * [ cos(r_{0}+wt) ; sin(r_{0}+wt) ]
for initial angle r_{0}, constant rate of rotation w and time t with magnitude of accleration a
then; your velocity is:
v(t) = integral(0>t) a(t) = v_{0} + a * [ (sin(r_{0}+wt)sin(r_{0}))/w ; (cos(r_{0})cos(r_{0}+wt))/w ]
for initial velocity v_{0}
and your position is:
x(t) = integral(0>t) v(t) = x_{0} + a * [ (wt.sin(r_{0}) + cos(r_{0}+wt)  cos(r_{0}))/w^2 ; (wt.cos(r_{0})  sin(r_{0}+wt) + sin(r_{0)})/w^2 ] + t*v_{0}
for initial position x_{0}
_{}
_{since the acceleration only lasts for 5 seconds; all of these become piecewise maps; defined as above for t = 0 > 5, and then after t = 5, you'd go back to normal equations of motion with:a(t>5) = [0 ; 0]v(t>5) = v(5)x(t>5) = x(5) + (t5)*v(5)}
and in all cases your rotation follows:
r(t) = r_{0} + tw
#4850080 Converting coordinate systems
Posted by lucadeltodesco on 16 August 2011  05:24 PM
Image.
So you have two coordinate systems A and B.
To go from coordinate system B to coordinate system A, you would premultiply the point/vector with AB^{1 }
Of course you can probably simplify the maths greatly, if your axis vectors form an orthonormal set of vectors, in which case the upper 3x3 part of the coordinate system basis is an orthogonal matrix, and so it's inverse is simply it's transpose and so to premultiply with B's inverse, you would just subtract the centre vector, then premultiply with the transposed upper 3x3 part.
#4846680 To goto or not to goto?
Posted by lucadeltodesco on 09 August 2011  08:03 AM
While I'm at it, I might as well add one more. Since we're using the goto for a quick and dirty exit, why not a return statement then?
loopFuncWithNiceName(); // whatever came after... // ... void loopFuncWithNiceName() { for (int i=0; i<n; ++i) { switch (some_array[i]) { case 0: //... break; case 1: if (some_condition()) return;// DONE!!! break; //... } } }
Because using a return doesn't give you the opportunity to do any cleaning up before the exit
#4839920 Determine which side of a line a point is
Posted by lucadeltodesco on 25 July 2011  03:47 AM
in 2D each vector (vx ; vy) has 2 perpendicular vectors (vy ; vx), (vy ; vx) for which we normally choose (vy ; vx) to be the principal perpendicular, and then the perpdot product between vectors u,v is perp(u) dot v = u.x * v.y  u.y * v.x
#4839706 Vector 2D normals
Posted by lucadeltodesco on 24 July 2011  01:43 PM
#4837929 How do I pick the correct ring when ray casting?
Posted by lucadeltodesco on 20 July 2011  06:28 AM
index = MathTools.Min3Index( Math.Abs(Math.Min(Vector3.Dot(pointEnter, Vector3.UnitX), Vector3.Dot(pointExit, Vector3.UnitX))), // 0 Math.Abs(Math.Min(Vector3.Dot(pointEnter, Vector3.UnitY), Vector3.Dot(pointExit, Vector3.UnitY))), // 1 Math.Abs(Math.Min(Vector3.Dot(pointEnter, Vector3.UnitZ), Vector3.Dot(pointExit, Vector3.UnitZ))) // 2 );
should be:
index = MathTools.Min3Index( Math.Min(Math.Abs(Vector3.Dot(pointEnter, Vector3.UnitX)), Math.Abs(Vector3.Dot(pointExit, Vector3.UnitX))), // 0 Math.Min(Math.Abs(Vector3.Dot(pointEnter, Vector3.UnitY)), Math.Abs(Vector3.Dot(pointExit, Vector3.UnitY))), // 1 Math.Min(Math.Abs(Vector3.Dot(pointEnter, Vector3.UnitZ)), Math.Abs(Vector3.Dot(pointExit, Vector3.UnitZ))) // 2 );
#4837891 How do I pick the correct ring when ray casting?
Posted by lucadeltodesco on 20 July 2011  05:28 AM
Back to finding the nearest plane based on intersection with sphere. The issue there was that the sphere is seethrough and so when selecting part of a circle at the back of the sphere it doesn't behave intuitively; perhaps instead you should use both intersections with the sphere and take the minimum over the 3 circles with both intersections considered.
#4824745 In need of simple physics equation for distance but I can't find it anywhere
Posted by lucadeltodesco on 18 June 2011  02:08 AM
Firing your cannon horizontally, from a height 'h' to cover a distance 'd' before hitting the ground you have: (using your syntax)
d = Vix*T
0 = h  1/2 gT^2
so
T = sqrt(2h/g) and
Vix = d*sqrt(g/(2h))
g being your gravity
#4818104 Transfer of Angular Velocity?
Posted by lucadeltodesco on 31 May 2011  06:51 PM
given that he and his feet are stationary w.r.t to the wheel as he is not sliding, the linear velocity of the person at his centre is (wx), and the linear velocity of his feet are w(xr) and w(x+r).
assume the person has an angular velocity of W, then the linear velocity of his feet are wx  Wr = w(xr) and wx + Wr = w(x+r), which is iff. W = w.
#4817930 Transfer of Angular Velocity?
Posted by lucadeltodesco on 31 May 2011  10:47 AM
#4817800 Transfer of Angular Velocity?
Posted by lucadeltodesco on 31 May 2011  02:39 AM
Note that if you jump from an offcenter point of the platform you drift outwards because centrifugal force ceases to be balanced by friction as soon as you break contact.
Correction for OP:
If you jump from an offcentre point then you will move at a tangent to the centre (whilst spinning at same rate as before) because the centripetal force which was provided by the friction (being the force that keeps you moving in a circle) is no longer present.
#4817483 Gödelization  help needed.
Posted by lucadeltodesco on 30 May 2011  06:51 AM
An intuitive proof for existance would be:
let N be a number, either N is prime or it is not prime.
If it is not prime then there must exist a prime P and a possibly nonprime M (otherwise N would be prime).
In the same way, repeat with M instead, and eventually you either get a prime number, or 1.
from which it is easy to construct a formal inductive proof.
Proof of uniqueness is a little bit harder, a sketch proof would be:
Let N be the smallest integer expressible as the product of two minimal; nonidentical sets of primes s1,s2..sn q1,q1...qm
as N is the smallest such number, then s1, and s2...sn, must have unique factorisations as they are smaller than N.
p1 then, must either divide s1, or s2...sn (or both, not important) and as all are prime, si = qj for some i,j. By removing si,qj from the two nonequal factorisations we get two smaller, equal numbers. as they are smaller than N, by assumption they have unique factorisations and so the two factorisations cannot be different.
#4803500 acos vs cos
Posted by lucadeltodesco on 27 April 2011  05:57 AM
the angle between two vectors (not points) can be easily found by the inner product <x,y> = xycos(t), rearranging to give t = acos(<x,y>/(xy))
the choice of the branch cut for acos means that the value 't' found above for the angle between two vectors is the smallest such angle, it's easy to see that equally t + 2*n*pi for integer n are also solutions to the original equation <x,y> = xycos(t)
#4802659 How do you pick an edge?
Posted by lucadeltodesco on 25 April 2011  08:06 AM
probably what could be even better (and far simpler), is to simply find the first intersected triangle, and evaluate if the intersection point is close to an edge/vertex to choose those instead of the triangle face. if you needed to have wireframe; having triangles with no solid faces too, then you could simply continue along ray if you intersect a triangle which has no face, and the intersection point is not sufficiently close to the edges/vertices.
in both cases you can project the intersection point onto the given edge/vertex to get a picking point on the feature if needed.
my second proposed method would likely be much more easily transformed to make the 'thickness' of the edge/vertex be screenspace constant which would probably be far preferable as then the distance from cursor to the visual representation of the edge/vertex required to select it wouldn't become too large as edge/vertex approaches near clipplane, or too small to be able to reliably select the edge/vertex if it moves very far away from the camera.