WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-30-2006, 01:10 PM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Locating the Coordinates of Vertices for on the fly objects

Hi again,

I'm trying to determine the location of a vertex after it has been transformed. Is there any kind of function call that will give me the coordinates in (X,Y,Z) space? I've already tried the usual, viz.get and so forth with no avail.

The actual vertex is being heavily manipulated by both the camera location and a wanda tracking device, which prevents me from actually 'knowing' where the item is at any time.

Here is my code. You'll notice it sets up a primitive tracker. What we want to do it use the 'intersect' function with the two points that make up the line and determine if it intersects and object.

Code:
import viz
viz.go()

#Trial Object

view = viz.get(viz.MAIN_VIEWPOINT)

#This will specify the shared memory key for retrieving trackd data
PORT_TRACKD = 4126

#Create a trackd tracker (This will be attached to sensor 1 on key 4126)
tracker = viz.add('trackd.dls')

viz.startlayer(viz.LINES)
viz.vertex(0,0,0)
viz.vertex(10,0,0)

object = viz.endlayer()
object.dynamic()



def mytimer(num):	

	t_data = tracker.get()
	head = view.get(viz.HEAD_POS)
	object.translate(view.get(viz.HEAD_POS))
	object.rotate(view.get(viz.HEAD_AXISANGLE))
	object.translate(0,-2,15,viz.RELATIVE_LOCAL)
	object.rotatequat(t_data[3],t_data[4],t_data[5],t_data[6])
	

	
viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.01,viz.FOREVER)
Thank You

George Lecakes
Rowan University
Reply With Quote
  #2  
Old 10-30-2006, 02:28 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Check this thread for a way to do this in Vizard 3.0

http://www.worldviz.com/forum/showth...ghlight=vertex
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
  #3  
Old 10-30-2006, 03:04 PM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Is there a way to do it in vizard 2.XX, cause that is what we are using at this University.
We have not yet moved to 3 since it still is the beta version and the work we are doing requires a fully released product version.

George Lecakes
Rowan University
Reply With Quote
  #4  
Old 10-30-2006, 05:29 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
There is no way to do this directly in 2.5. You can save the transformation of the Vertex every time you change it and mulitiply it by the transform of the On-the-fly object. This is simlar to the second example in the post I linked to above.

While Vizard 3.0 is still in develpment, it is actualy more stable than Vizard 2.5.
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
  #5  
Old 10-30-2006, 08:28 PM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
I'll have to tell that to my professors and maybe see if I can get this
problem fixed.

Thanks,
George
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:44 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC