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++ 48428 articles. 31 followers. Post

3 Replies
432 Views

Similar Articles

[PageSpeed] 35


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

From 3d To 3d
Hi to all, i would like to know if i can create a 3d model of the face of a person without using a 3D scanner. Could i use a normal digital photo camera??? Thanks Yeap you sure can, Its called structure from motion, you need to take several images from different angles, calculate the F matrix for the camera parameters of each camera, detect features common in all images (try harris corners) reproject the features from the images or view frame into some common view frame, triangulate the features (aka vertexes), taking into account reprojection errors etc and your done. Arash Partow ___...

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

3D visulaisation of 3D matrix for a 3D CA
Hi, I have a 3D matrix, of the form {{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10,11,12}, {13,14,15,16}}, {{17, 18, 19, 20}, {21, 22, 23, 24}, {25, 26, 27, 28}, {29, 30, 31, 32}}} I want to plot this matrix, where every number is a unit cube, to give a sort of 3D grid, where the number gives the colour. In reality most numbers would be 0, which would be transparent. I want to do this as I'm developing a 3D partitioned cellular automaton, and have it defined over structures of this sort, and I want to be able to visualise its development. In 2D I've used MatrixP...

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 visulaisation of 3D matrix for a 3D CA #2
Hi, I have a 3D matrix, of the form {{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10,11,12}, {13,14,15,16}}, {{17, 18, 19, 20}, {21, 22, 23, 24}, {25, 26, 27, 28}, {29, 30, 31, 32}}} I want to plot this matrix, where every number is a unit cube, to give a sort of 3D grid, where the number gives the colour. In reality most numbers would be 0, which would be transparent. I want to do this as I'm developing a 3D partitioned cellular automaton, and have it defined over structures of this sort, and I want to be able to visualise its development. In 2D I've used MatrixP...

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

Does move actually move?
If I remember correctly, when you move a file in msdos (ver 6.22) it copies the file to the new dir and then deletes it. However, if you move a file in W98/XP by using windows explorer, it doesn't really move it like old dos would; the directory entry or FAT is simply updated. This is much safer, faster, and doesn't fail if you don't have enough space for two copies at the same time. With XP, does moving a file at the command line with 4dos differ than moving it with 4nt? I think 4dos copies/deletes and 4nt updates the FAT. Can anyone verify this? Anthony D&...

3D Concept mapping / 3D Mind mapping with 3D Topicscape
An information-organization tool that lets you lay out information the way you think, but without the limitations of 2D sheets. Then view in a landscape that shows how the information is related. Can store files, snippets of files (in a container it makes for you automatically) or fileless notes, at every node or topic. Grabs web pages and saves them in a background queue under the topic you select. http://www.topicscape.com/ You can use 3D Topicscape for a free 60-day trial. ...

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