get vertex with on the fly object
Hello, I was wondering if it's possible to get the value of a vertex of an on-the-fly object? I create a line, then scale it, then I need the value of the scaled vertex.
|
Please help, all I need is a get method for the vertex position. I'm pretty sure the values exist somewhere. Something like:
[ x, y, z ] = myOnTheFlyLine.getVertex( 0 ) # to get the x,y,z of the 0th vertex [ x, y, z ] = myOnTheFlyLine.getVertex( 1 ) # to get the x,y,z of the 1th vertex |
Sadly, Vizard provides no way to get the vertex positions:( The workaround is to recorde the positions of the vertexes when you add/modify them.
|
Sadly that workaround would not work for me, as after I set a vertex I scale the object. To get that new point, I would need to do quite a bit of math which I would like to avoid...
|
Hmm. OK, heres a possible solution: add a child object to the on-the-fly object before you scale it. Translate the child object to the position of the vertex you are interested in. Then scale the on-the-fly object. Then print out the child objects position.
Code:
l = viz.add( 'logo.wrl' ) |
Interesting, I shall try it and let you know if it works out.
|
Hey. I tried it, however the position of the ball, while it appears in the world where it is translated/scaled to, the position values remain the same. :-(
|
Boy that Vizard is a whily one. Maby I'll have something for ya tomorrow. Something with the new viz.link() functianlity or something.
|
I got it!
b.get( viz.POSITION ) gets the position locally, while b.get( viz.POSITION, viz.ABSOLUTE_WORLD ) gets what I want :-) Thanks for the help! |
Instead of adding a model, such as 'ball.wrl', add a Group to increase performace and avoid having to remove the ball.
Code:
vertexTracker = logo.add( viz.GROUP ) |
All times are GMT -7. The time now is 09:14 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC