polyfrag 2504 Posted December 6, 2017 (edited) How do you, say, given a vector in a gravitational field, reflect or alter the vector, by the vector of the gravity? Ie if the gravity vector gives a plane and you want to make the vector perpendicular to the gravity vector but as close as possible to the original? Doing this for https://github.com/dmdware/f69 as per http://gsjournal.net/Science-Journals/Essays-Relativity Theory/Download/6866 walk space generation. Also how do you sometimes give it a little bit of an offset off the plane, eg by a 3 degree offset up above or -3 for below the plane along the original forward direction but off the perpendicular to gravity plane now. The other thing I wanted was to make the vector follow an iso-contour line along its original path, which I can do. Also if anybody is familiar with eg ray tracing I need to also refract the vector by the gravity vector acting as the increasing-density refractive medium, with the refractive indices being the gravity magnitudes at those places, and I'm not sure if it should be a dot product that is along the vector corresponding with the gravity vector, or the whole gravity vector itself. Also I'm not sure if the best results will be obtained by keeping all the resulting vectors on the original forward path, only reflected or altered by the plane in question, but I think it is best for making a mesh surface. Edited December 6, 2017 by polyfrag 0 Share this post Link to post Share on other sites

sjhalayka 0 Posted December 11, 2017 Have you gotten Newtonian gravity working? 0 Share this post Link to post Share on other sites

haegarr 7406 Posted December 11, 2017 On 6.12.2017 at 11:41 PM, polyfrag said: How do you, say, given a vector in a gravitational field, reflect or alter the vector, by the vector of the gravity? Ie if the gravity vector gives a plane and you want to make the vector perpendicular to the gravity vector but as close as possible to the original? Searching the internet for "vector reflection" gives you a ton of hits. Just the first hit for me answers your question. The closest vector on the plane (i.e. perpendicular to the plane's normal) can be found by using the cross product twice and rescaling the result, as is usual when a basis should be computed. So the first cross product is used to calculate a vector perpendicular to both the normal and the initially given vector: k := n x v Then the second cross product used on the previous result and the normal gives a vector in the desired direction: m := k x n The rescaled variant of the vector is what you're looking for: v' := m / ||m|| * ||v|| That works if and only if v and n are not collinear, of course. On 6.12.2017 at 11:41 PM, polyfrag said: Also how do you sometimes give it a little bit of an offset off the plane, eg by a 3 degree offset up above or -3 for below the plane along the original forward direction but off the perpendicular to gravity plane now. This can be done simply by applying a rotation on the vector. The rotation's axis is given as cross product of the vector and the normal. 1 Share this post Link to post Share on other sites

sjhalayka 0 Posted December 11, 2017 Don't forget that, like refraction, where the material is densest, movement is slowed. There is extra time for acceleration toward the gravitating body to occur. For instance, Mercury's perihelion shifts over time due in part to this slowed movement. 0 Share this post Link to post Share on other sites

polyfrag 2504 Posted December 12, 2017 14 hours ago, sjhalayka said: Have you gotten Newtonian gravity working? Yeah check out all my stuff http://sites.google.com/site/3brane4bulk I'm doing this stuff on paper so I'll figure it out 0 Share this post Link to post Share on other sites

sjhalayka 0 Posted December 12, 2017 (edited) Well, you're at least halfway there... right? you've allowed for the curvature of space, and now you have to allow for the curvature of time. You should find that the deflection of light is twice the Newtonian angle. You can get the angle by getting the slope. Edited December 12, 2017 by sjhalayka 0 Share this post Link to post Share on other sites