View Single Post
  #1  
Old 03-16-2011, 02:03 PM
xcuddlex xcuddlex is offline
Member
 
Join Date: Feb 2011
Posts: 11
Question artoolkit load 3d objects into application

greetings
i've found an example code on how to save a marker pattern on the resource directory. it works ! i love it. and i wonder is it possible to create a menu where user can load desired pattern and 3d objects into the application?
let say this is the initial code

#Create marker from pattern file
marker = camera.addMatrixMarker(0, width=1000)
#Add model
model = viz.add('ball.ive')
#Link model to marker sensor
viz.link(marker,model)

okay now how can i create a GUI menu where i can use to load the saved marker and 3d objects so that the updated code would be

#Create marker from pattern file
marker = camera.addMatrixMarker(0, width=1000)
marker = camera.addMarker('new.patt', width=1000)
#Add model
model = viz.add('ball.ive')
model2=viz.add('secondball.ive')
#Link model to marker sensor
viz.link(marker,model)
viz.link(marker2,model2)

is it possible to do so?
i've created the dropdown menu as below
#Create a menu subject
MainMenu = menu.add( 'Main Menu' )
#Main Menu
#Add dropdown list of theme options to Main menu
themeDropDown = MainMenu.add( viz.DROPLIST, 'Model')
themeDropDown.addItems( ['Import','Delete','Edit'] )

i'm a beginner. i never use python before. so i dont know how to put action handling into the menu.

if it can save a pattern. i think it is possible to load a pattern and 3d objects too. please help. i want to add and make the artoolkit more interactive. any suggestion on how to do it ? thanks
Reply With Quote