WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 06-18-2014, 08:38 AM
pwsnow pwsnow is offline
Member
 
Join Date: Apr 2012
Posts: 23
Many thanks Jeff.

Below is the code I'm using for the two camera set up. I'm testing using different types of markers.

Code:
import viz
import vizshape
viz.go()

#Add ARToolkit extension
ar = viz.add('artoolkit.dle')

video = viz.add('VideoCamera.dle')

#Connect to next available generic video capture device
cam = video.addWebcam(1) 
cam2 = video.addWebcam(0) 

#Create camera using first available webcam
camera = ar.addCamera(cam)
camera2 = ar.addCamera(cam2)

#Create marker from pattern file
#marker = camera.addMarker('ar/patt.worldviz',width=1000)
#marker2 = camera.addMarker('ar/patt.kanji',width=1000)
#marker3 = camera2.addMarker('ar/patt.hiro',width=1000)
#marker4 = camera2.addMarker('ar/patt.sample1',width=1000)
#marker5 = camera.addMultiMarker('ar/patt.multi',width=1000)
marker1 = camera.addMatrixMarker(6,width=1000)
marker2 = camera2.addMarker('ar/patt.worldviz',width=1000)
#marker2 = camera2.addMatrixMarker(31,width=1000)
marker3 = camera.addMatrixMarker(41,width=1000)
marker4 = camera2.addMatrixMarker(54,width=1000)

m1Axes = vizshape.addAxes(.9 )
axesLink1 = viz.link( marker1, m1Axes )
m2Axes = vizshape.addAxes(.9 )
axesLink2 = viz.link( marker2, m2Axes )


X = viz.addText3D('X',pos=[1.1,0,0],color=viz.RED,scale=[0.3,0.3,0.3],parent=m2Axes)
Y = viz.addText3D('Y',pos=[0,1.1,0],color=viz.GREEN,scale=[0.3,0.3,0.3],align=viz.ALIGN_CENTER_BASE,parent=m2Axes)
Z = viz.addText3D('Z',pos=[0,0,1.1],color=viz.BLUE,scale=[0.3,0.3,0.3],align=viz.ALIGN_CENTER_BASE,parent=m2Axes)


video.getWebcamNames(available=False)
camera.setThresh(99)
camera.setGlobalScale(0.93)

camera2.setThresh(99)
camera2.setGlobalScale(0.93)


def UpdateView():

	print marker1.getEuler()
	print marker2.getEuler()

vizact.ontimer(0,UpdateView)
I would like to use more than one camera so that I'm guaranteed to have the marker in view when the user moves the physical cube.

In your single camera example above you print two eulers out. Are they the marker and axes euler separately?

Many thanks,

Peter
Reply With Quote
  #2  
Old 06-18-2014, 10:11 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The second set of values on each line is the marker position. If the marker width is not specified accurately when adding the marker, the position values will be scaled.
Reply With Quote
Reply

Tags
artoolkit

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
the difference between transform matrix and setEuler,setPosition,setScale arscarsc Vizard 1 08-24-2010 10:17 AM
Camera distance problem CRI Vizard 0 07-28-2010 11:58 AM
Be a Marker for Camera Tracking CRI Vizard 2 05-31-2010 02:09 PM
Matrix Transform and Bumpmap GiudiceLab Vizard 0 11-27-2009 01:42 PM
transform deprecation problem cade_mccall Vizard 7 11-16-2007 03:59 PM


All times are GMT -7. The time now is 02:24 AM.


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