COMPGROUPS.NET | Post | Groups | Users | Stream | Browse | About | |

### moving in 3D

• 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

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.

4dfd#

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


 0

it works but not if i move a source away either in z or x axis.

 0

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
--

 0
 comp.lang.c++ 48340 articles. 29 followers.

3 Replies
400 Views

Similar Articles

[PageSpeed] 28

• Email
• Follow

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...

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...

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...

plotting a moving picture on 3d axis
I want to plot ball.tif on a 3d axis which in every itteration the coordinates of its place are changed (e.g it starts in [0,0,0] goes to [0.1,0.1,0.1], [0.2,0.2,0.2] and so on until it stops in [1,1,1]). I tried the method which was described here http://www.mathworks.com/matlabcentral/newsreader/view_thread/277942 but it creates a new axis includes only the picture which can't move. How can I place my picture on a 3d axis and change its position? ...

Moving Color channels for Mars 3D
Hello, Maybe I'm going about this all wrong but... I''m trying to generate 3D images using GIMP. I can use Colors/filters/Compost to get NASA's R & L photos into the appropriate red/cyan channels. I'd can't seem to move the channels themselves to reposition the colors ie, move only the red channel. How can I move the indificual color channels (not layers) using GIMP. NASA has instructions that work in Photoshop but GIMP doesn't seem to accept the Select/All Edit/Paste portion (hence, Colors/Filters/Compose) and I can't move the color channels. Th...

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...

move in a 3D environment using the mouse
Hello folks! I have created a 3D environment (really basic) with matlab and I need to move inside it using the mouse. Can anyone help me? Francesco wrote: > > > Hello folks! > > I have created a 3D environment (really basic) with matlab and I > need > to move inside it using the mouse. > > Can anyone help me? did you trying clicking and dragging or any of the controls designed for that purpose? if not, then i doubt if anyone could really help you. if you did then tell us what you tried that doesn't work. dave wrote: > > > Francesco wrote: >>...

Move 3D Objects using handles
Hi all, Im craeting a simple 3d app where one can create 3d primitives etc. now what i wanna do is when a user selects a 3d model in the viewport and requests for it to move, i want to show handles in each axis (x,y,z). the handles are just straight lines created in objects view space. now these handles are applied the same transformations as the object is (objtrans * camtrans * perspective). now if the camera is far away the objects appear small (as they should) and so do the handles. Example transformation objtrans = matrix.identity camtrans = matrix.identity.move(0,15,-75) Now i get the v...

Moving 3d surf plot GUI
Hi everyone. I made a GUI which shows a 3d plot from a surf command in a axes object. I want to know if is possible to rotate 3d this plot as you will do with any surf plot made in MatLab frontdesk. Thanks in advance, Nicolas "Nicolas" <odiseo1982@yahoo.com> wrote in message <gh6rbu$qmc$1@fred.mathworks.com>... > Hi everyone. I made a GUI which shows a 3d plot from a surf command in a axes object. I want to know if is possible to rotate 3d this plot as you will do with any surf plot made in MatLab frontdesk. > > Thanks in advance, > > Nicolas Well, I ...

Translation/Moving of a Plane in 3D space
I have a set of 3D points out of which I have fitted a plane using Principal Component Analysis. Now, I want to generate/create a plane parallel to this one at a particular distance or passing through a point and find how these individual points project on that new plane. Any help or input is appreciated. The following code is an example. ------------------- randn('state',0); X = mvnrnd([0 0 0], [1 .2 .7; .2 1 0; .7 0 1],50); plot3(X(:,1),X(:,2),X(:,3),'bo'); grid on; maxlim = max(abs(X(:)))*1.1; axis([-maxlim maxlim -maxlim maxlim -maxlim maxlim]); axis square view(-23....

In a 3D plot XaxisLocation fails to move.
Hi, In a 3D plot I cannot change the postion of the xaxis ticks, or ticklabels. For example: >>mesh(magic(25)); >>set(gca,'XAxisLocation','top'); Fails to move the the axis, it stays on the bottom right of the plot. Thanks in advance. ...

Cannot move JSplitPane Divider with Canvas 3D
I hava a SplitPane with a Button at the left side and a Canvas 3D at the right side and I can only move the divider to the button side. When I want to make the Canvas3D smaller the divieder doesn't move in that direction. Can anybody help me? A problem to do with mixing heavyweight and lightweight. Put the canvas in a JPanel, min and max sizes for the panel then add this panel to the splitpane. See below // In order to get the heavyweight Canvas3D to work correctly in a JSplitPane // we need to first put it in a JPanel and setMinimum and Maximum sizes for that...

Moving "elements" of a 3D model
Hello, Prefix: I am very much new to 3d modelling and programming. I appreciate that this maybe somewhat off topic. I was wondering if anyone has recommendations as to an easy method of moving elements of a 3D model. For example a rudder on a plane. I have written my own 3ds file format parser and openGL renderer which works for static models, so i could have a model of a plane, and then individual models for each of the "moveable" elements. Using this approach i believe that this would require that the axis of rotation etc would need to be hardcoded into the source code for each ...

Preventing 3d axes from moving when zooming or panning
Hi, How do I prevent a 3d axes from moving when zooming or panning and "axis equal" is on. Thanks ...

Animation
I have a 3d point cloud data for each frame on a recorded sequence. I am trying to animate a 3d plot of this data and / or record it to an avi. My current attempt allow me to record the "animation" ok, but as the 3d point cloud moves and rotates the scale of the plot changes. How can I force the scale to remain exactly the same across the whole sequence, even though the could data is moving around in 3d space (translations and rotations). Due to the large movement it isn't feasible to simply limit the axes. Currently, I am creating a new figure each frame, which I assume is pa...

a MATLAB GUI to move anywhere in a 3D scene
I'm trying to built a MATLAB GUI to move anywhere in a 3D scene and record the position. My best result till now is a mouse operated flyby with 3 options: right,left and straight. any suggestions to improve it? Francesco wrote: > > > I'm trying to built a MATLAB GUI to move anywhere in a 3D scene and > record the position. > My best result till now is a mouse operated flyby with 3 options: > right,left and straight. > > any suggestions to improve it? well, 3 rotation axis is nice. plus 3 linear movements directions. and maybe a zoom also. and it can be nice...

moving 2d picture inside 3d maze
hello, the object seem to be just moving in the same direction even though it rotate. How to make it move in other direction? Or it can't be done unless it's a loaded 3d object file? Is there any example available? thank you ...

moving through a 3D matrix using 8*8*8 blocks.
Hi, I have a 1024*1024*32 matrix 'imgsq'. I want to move through this matrix using 8*8*8 blocks. I cant figure out a way how to progress through the matrix using 8*8*8 blocks, in an efficient manner. I want to move in the following order : Take the first 8*8*8 block of the matrix i.e. imgsq(1:8,1:8,1:8) process it. next should be imgsq(1:8,1:8,9:16) ... continue the same procedure till imgsq(1:8,1:8,24:32). then it should move to imgsq(1:8,9:16,1:8).. imgsq(1:8,9:16,24:32) and so on till imgsq(1:8,1016:1024,24:32) and then start at imgsq(9:16,1:8,1:8) to imgsq(9:16,1016:1024,24:32).......

Moving Bones...Simple 2D and Simple 3D software for beginner.
I am looking for software to allow me to animate bone images. For example, the showing the bones of the knee to bend and straighten. I imagine this is very difficult, but would like to take a shot at it. I would first like to start with 2D (probably easier) then move onto 3D. If anyone could tell me where to start that would be great. Thank you! ms wrote: > > I am looking for software to allow me to animate bone images. For > example, the showing the bones of the knee to bend and straighten. I > imagine this is very difficult, but would like to take a shot at it...