WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-28-2012, 10:08 PM
allanjjj allanjjj is offline
Member
 
Join Date: Mar 2012
Posts: 2
Unhappy Vizard AR Problem.....

i saw the code below is to display avatar only when the marker is shown, but when I run the script, the avatar still shows and jump randomly if no marker is shown in Camera. Is there any problem with the code below?

import viz
viz.go()

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

#Create camera using first available webcam
camera = ar.addWebCamera()

#Create matrix marker
marker = camera.addMatrixMarker(0,width=1000)

#Add avatar model and set state 1
avatar = viz.add('vcc_male.cfg')
avatar.state(1)

#Link avatar model to marker sensor
viz.link(marker,avatar)

#Method that update if the marker is visible
def updateVisible():
if marker.getVisible():
avatar.visible(viz.ON)
else:
avatar.visible(viz.OFF)

vizact.ontimer(0,updateVisible)
Reply With Quote
  #2  
Old 03-30-2012, 09:16 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
How long is the marker out of view, a fraction of a second or several seconds? Are other markers in view? The code looks fine but you may have problems if the marker flashes in and out of view or if something else is seen as a marker.
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
Vizard problem mizutani_jun Vizard 4 01-09-2011 04:39 PM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 12:13 PM
newbie problem getting vizard to work Colin Vizard 2 11-10-2006 11:54 AM
problem talking to usb device in Vizard Vbents Plug-in development 2 06-15-2006 04:08 PM
Vizard Crashes: causes are hard to determine, possible problem with the viz code vr_boyko Vizard 1 01-07-2005 11:52 AM


All times are GMT -7. The time now is 09:16 AM.


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