moving in 3D

  • Follow


HI
I've two positions, one is nearer than the other in z. Both have
different x. Now how should I turn them together?

-----------

double theta = (double) heading * 3.14 / 180.0;



SourcesPos[i][0] = -float(cos(theta)); //not ok if i do: -0.2

SourcesPos[i][1] = -float(rand()%2);

SourcesPos[i][2] = -float(sin(theta)) //not ok if i do +0.7

---------
Many thanks
Michael
0
Reply Mike 5/25/2010 8:56:13 AM

On May 25, 11:56=A0am, Mike <michael.sg...@gmail.com> wrote:
> HI
> I've two positions, one is nearer than the other in z. Both have
> different x. Now how should I turn them together?
>
> -----------
>
> double theta =3D (double) heading * 3.14 / 180.0;
>
> SourcesPos[i][0] =3D -float(cos(theta)); //not ok if i do: -0.2
>
> SourcesPos[i][1] =3D -float(rand()%2);
>
> SourcesPos[i][2] =3D -float(sin(theta)) //not ok if i do +0.7


Huh? Mike, maybe someone smarter gets what you are doing, i don't.

If no one replies something helpful then read that post:
http://groups.google.com/group/comp.lang.c++/browse_frm/thread/942ca0869815=
4dfd#

There it eventually describes how to post in a way so we can help
you.

0
Reply ISO 5/25/2010 10:01:27 AM


it works but not if i move a source away either in z or x axis.
0
Reply Mike 5/25/2010 11:34:39 AM

On 5/25/2010 7:34 AM, Mike wrote:
> it works but not if i move a source away either in z or x axis.

I think you're lacking proper algorithm, for which you can seek help in 
the 'comp.programming' NG or the 'sci.math.*' hierarchy.  When you have 
a question on the C++ *language*, come back and ask it.

V
-- 
I do not respond to top-posted replies, please don't ask
0
Reply Victor 5/25/2010 12:42:28 PM

3 Replies
244 Views

(page loaded in 0.095 seconds)

Similiar Articles:













7/28/2012 5:20:43 AM


Reply: