Re: Updated includes for BGT (includes bgt2py and 1st person sound pool)

A couple of things.  So, this is exactly what he said:

In spherical coordinates, we can describe a vector by specifying the following components:
• r which is the distance from the origin to the point
• θ which is the angle the radial vector makes with respect to the z-axis (i.e. up / down)
• φ which is the azimuthal angle that the radial vector makes with respect to the y-axis (i.e. rotation about the z-axis)
We can get spherical coordinates from cartesian coordinates (and vice-versa) using the transformation:
x = r * sin θ * cos φ
y = r * sin θ * sin φ
z = r * cos φ
where:
r = sqrt(x^2 + y^2 + z^2)
φ = arctan(y / x)
θ = arccos(z / r)
So, it looks like he is saying that θ is used for elevation instead of φ.  If that's the case, then x being sin(theta)*cos(phi) makes sense.
On a related mathematical but different note, One thing I have noticed about BGT is that if I declare a vector like so:
vector VF((IV.x+acc.x)*DT*sine(theta)*cosine(phi), (IV.y+acc.y)*DT*sine(theta)*sine(phi), (pos.z+IV*DT)+(0.5*9.81)*power(DT, 2)*cosine(phi));
it will declare the vector, but the values within the vector do not assign correctly.  in other words, values do not change correctly as they should, as if the math isn't actually completed.  In order to get them to assign correctly, I had to do this:

vector UpdateVel()
{
VF.x = (IV.x+acc.x)*DT*sine(theta)*cosine(phi);
VF.y = (IV.y+acc.y)*DT*sine(theta)*sine(phi);
VF.z = (pos.z+IV*DT)+(0.5*9.81)*power(DT, 2)*cosine(phi);
return VF;
}
Once I did that, the vector values assigned correctly.  So if the only way to get the values to assign correctly is to return the vector in a function, is there a way to have one function retirn all the vectors so that I don't have to make one for each one of them?  That would suck,  and, quite frankly, seems counterintuitive.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mahdi-abedi via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector

Reply via email to