Trin Posted July 21, 2010 Report Share Posted July 21, 2010 Hi lavas, i need to make a path through the marked points of my 3D object.Do i need to do the interpolation between points or i need to find the intersection of planes for each marked points. Does LabView have any kind of implemented feature that i can use? any idea or any examole will help me for sure. Cheers Quote Link to comment
vugie Posted July 21, 2010 Report Share Posted July 21, 2010 It depends on how exactly you want to represent the curve. If it is ok to connect your points with straight lines you may feed directly their coordinates to mesh primitive with "line strip" mode. If you want more smooth curve, you have to do interpolation - this is as simple as 1D interpolation separately for each coordinate. I assume that you know the order of your points, in other case you have to sort them somehow before and it may be more complicated than interpolation. Quote Link to comment
Trin Posted July 21, 2010 Author Report Share Posted July 21, 2010 Thx for your quick reply, do you have any example VI so i can get some ideas?! also, i have a problem i need to save my mouse coordination after each click, so use them as vertices. i use pick point method to get the coord, so i need something like a buffer to save the previous click as well,any idea? Quote Link to comment
vugie Posted July 21, 2010 Report Share Posted July 21, 2010 As for interpolation it would be something like this: For creating the buffer you may use i.e. Functional Global Quote Link to comment
Trin Posted July 23, 2010 Author Report Share Posted July 23, 2010 (edited) Thx vugie, as always quick and useful, i tried to apply the procedure on my cube, so when i click the marked points will be connected, but the result is, all the points are connected to the center of cube, i doubt may be because of the way i change the pick points value to cluster of array, i tried to use it without interpolation, but still no success. that would be nice if you or any one else can take a look at my VI and give me some hints. Thanks Edited July 23, 2010 by Trin Quote Link to comment
vugie Posted July 23, 2010 Report Share Posted July 23, 2010 Look carefully what are you doing: for each mouse click you get cluster of 3 coordinates, make a SINGLE element array of cluster of 3 coordinates (?), interpolate over this 1-element array (I don't know for how many samples you do it, but for default - linear interpolation, you'll get 1 usable sample and the rest will be Inf), and then create line out of it. So you create ONE line object, made of ONE point for EACH mouse click... Instead you should create a line object with null mesh outside the loop, keep its reference and at each mouse click add point to the buffer (kept in shift register for example), and UPDATE mesh of the line object out of WHOLE buffer. BTW, You use Mouse Down event. It is better to use Mouse Up, because Mouse Down fires continuously as button is hold. Quote Link to comment
Trin Posted July 26, 2010 Author Report Share Posted July 26, 2010 Thans Vugie, ur hints were really useful as usual, i tried to applied whatever you had said and i have just one more question,the problem with connecting line is that, when i want to connect two points from different faces of cube, they will connect to each other from the inside of cube, so user cant see the line,this probelm is true for the curves as well,i thought may be i should find the intersection of a plane that this two points makes and the connection line should be in that plane,Thats just a guess, may be some more idea? Quote Link to comment
vugie Posted July 26, 2010 Report Share Posted July 26, 2010 If the only goal is to let the user see the line, you may make the box semi-transparent... If it is not the case you have to calculate proper path by yourself. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.