moving in 3D

  • Permalink
  • submit to reddit
  • Email
  • 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

See related articles to this posting

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
comp.lang.c++ 48169 articles. 26 followers. Post

3 Replies
352 Views

Similar Articles

[PageSpeed] 55

  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Moving a 3D Point
Hi. I'm working on a 3D modeling application. I've succesfully implemented loading, picking, arcball rotation, etc. I'm currently working on mesh editing features. I've started out with the basic moving of a selected vertex. However, I've been running into some problems. Using glUnProject, I've been able to move it in XY space fine when I am viewing the object head-on. But if I arc-rotate the view, I can see that the Z-coordinate is always set to 1 even though I am getting the depth of the vertex from the depth buffer. What I would really appreciate is an example if any...

moving sources in 3D
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 --------- it's ok as long as i don't move one source away like +0.2 it gets messed up. But i need to get one source more to the left and back but moving sincronously. Many thanks Michael ...

moving objects with mouse in 3D
I am rendering the model using glMatrixMode(GL_MODELVIEW); after detecting the click on object (select/pick) I want to move the object according to the mouse movement I use gluUnProject to unproject the mouse coordinates Do I get a result as coordinates in local system ? Thank you in advance On Apr 10, 1:47=A0pm, "Yako...@gmail.com" <yako...@gmail.com> wrote: > I am rendering the model using > glMatrixMode(GL_MODELVIEW); > after detecting the click on object (select/pick) I want to move the > object according to the mouse movement > I use gluUnProject to unproje...

Simulation of moving 3D objects
Hi, I was wondering how would I go about simulating a moving 3D object. For example a cube or cone moving along a certain trajectory. Like a cone with apex in the x-y direction and moving along y=x^2 or something like that or even a cube if the cone is complex Thanks! Hatem Alismail wrote: > I was wondering how would I go about simulating a moving 3D > object. > For example a cube or cone moving along a certain > trajectory. Like a cone with apex in the x-y direction and > moving along y=x^2 or something like that Fix the axes bounds for the plot, or else when you m...

3D tracking/match moving
This week I "discovered" match moving software "SynthEyes" and I downloaded the free demo. Didn't ran all the tests yet but seems to work very nice. Very accurate too. Next week I'm going to do some more tests with moving/spinning objects and try some of my own video's. For only $350,- this is really interesting. Take a look at: http://www.ssontech.com/ or www.syntheyes.com V. "Vincent" <nospam@planet.nl> wrote in message news:<41953074$0$8638$ba620dc5@nova.planet.nl>... > This week I "discovered" match moving software &quo...

Move 3d object with wiimote..
Hi all.. I need some help in here. I'm trying to move 3d figure in matlab with my wiimote so it can roll and pitch. I'm using Wiilab (http://netscale.cse.nd.edu/twiki/bin/view/Edu/WiiMote). I success to move the 3d figure with a wiimote but it's not perfect. When wiimote's rolling 90 degree (or -90 degree) from starting position (wiimote at the table, pointing towards object at the screen), the object doesn't move as i expect. And it happens too if wiimote's pitch 90 degree (or -90 degree). I put my script in here: global wm; addpath C:\'Program Files'\Wi...

3D animation / moving camera
Hello, I was trying to build a 3D animation like the well known "20th Century Fox" clip. I have a 3D object and what I want to do is record a clip that starts looking at the top of the object and then moves to the front of it, while zooming out a little. I was trying to do this in DAZ Bryce 5. However, it seems that only objects themselves can be animated, but not the camera. Every time that I move the camera (that is, the viewing angle), and then record a key frame, the camera moves for all key frames and hence I get no animation at all. Does anyone have any advice o...

Moving inside the 3D space
Hi, everyone! I'm learning to use 3D modellating in AutoCAD 2002, and would like to move inside a 3D house. Is there any command for walking inside the model, passing through the walls (something like track or dooly tool present in other software packages, like VIZ)? I tried the command for setting the distance of the camera but, if I have a wall in front of me, the visual keeps beeing obstructed by is (just like as I were using the zoom tool, except for the perspective change). Is here any way for doing what I need? Thanx in advance. -- Marco Iannaccone FAKEcinemar...

Moving origin/coordinate system in 3d.
Im using the pst-3dplot package to make fairly complicated 3d pictures. There's an option in normal pstricks where you can move the origin of the coordinate system you are drawing in eg. \pset{origin={2,5}}. Is there something similar for use in 3d? I have already tried to use this command with an extra coordinate, but it doesn't work. I would like to be able to write something to the effect of: \begin{pspicture}(-3,-3)(3,5) \pstThreeDCoor [xMax=5,yMax=5,zMax=5,xMin=0,yMin=0,zMin=0, nameX=$X$,nameY=$Y$,nameZ=$Z$] \pstThreeDBox[origin={3,4,6},rotX=45](0,0,0)(2,0,0)(0,2...