LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

got bored, maybe this will help someone

So Altenbach did his rotate 2D image, so I decided to do a rotate 3d graph, as this may be useful if someone wants to spin a 3d image programmatically. I just simply stuck my rotate 3d VI I created into the 3d Graph Properties - Torus example by NI that comes with LabVIEW. I used rotation matrices. I don't know if this matrix multiplication is the most efficient way, but it works. If anyone wants to rotate an image around a different axis, they just have to figure out the rotation matrix and replace mine with theirs, so it's fairly scalable. Everything else should take care of its self. If you want to rotate around either the x or y axes, those rotation matrices can be found easily on wikipedia.

 

 

Message Edited by for(imstuck) on 05-27-2010 11:21 AM
Message Edited by for(imstuck) on 05-27-2010 11:22 AM
Message 1 of 5
(4,589 Views)
I should add, you can see it a lot better if you change the plot style to something other than cwSurface. Also, becuase I put the indicator terminals, if you want you can use shift registers and a timer to decide whether or not to update the rotation on that loop interation or not, thus controlling the rate that it spins at. I'll put an example of that if I get a chance.
Message Edited by for(imstuck) on 05-27-2010 01:06 PM
0 Kudos
Message 2 of 5
(4,517 Views)

Don't forget that we have certain primitives in the geometry palette that do this directly. For example 3D Cartesian Coordinate Rotation (Direction) VI

 

It might be significantly simpler to use Euler rotations. That's what I use these days. 🙂

0 Kudos
Message 3 of 5
(3,433 Views)

@altenbach wrote:

Don't forget that we have certain primitives in the geometry palette that do this directly. For example 3D Cartesian Coordinate Rotation (Direction) VI

 

It might be significantly simpler to use Euler rotations. That's what I use these days. 🙂


Ugh, euler angles. Used those ad nauseam in my aero engineering days. They do turn out to be quite important though!Smiley Tongue

0 Kudos
Message 4 of 5
(3,354 Views)

Bonus points for reinventing the wheel and using Quaternions. They are typically used as the math for computer graphics. I would be curious to see if they are faster.

 

Although I have to admit, they are bizarre to wrap your head around at first.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 5 of 5
(3,321 Views)