Darkmax
11-11-2010, 11:25 AM
I'm having troubles trying to resolve how i can put a texture of a scene/viewpoint into a object?
For example in this code i want to show in a painting what is happening in scene 2.
And in scene 2 i load artoolkit, but i can only show the video and not the scene 2 or the subwindow of the scene 2 or the viewpoint that is on the scene 2.
Help if someone know how to resolve this.
import viz
viz.go()
subWindow = viz.addWindow()
subView = viz.addView()
subView.setScene(2)
subWindow.viewpoint(subView)
#subWindow.visible(0) #doesn't show the subwindow
#Add ARToolkit extension
ar = viz.add('artoolkit.dle')
video = viz.add('VideoCamera.dle')
cam = video.addWebcam()
#Create camera using first available webcam
camera = ar.addCamera(texture=cam,param=None,flipVertical=F alse,thresh=None,globalScale=None,window=subWindow )
#Create marker from pattern file
marker = camera.addMatrixMarker(3,width=1000)
#Add logo model
logo = viz.add("logo.ive",viz.WORLD, 2)
#Link logo model to marker sensor
viz.link(marker,logo)
galeria = viz.add("gallery.ive")
pintura = galeria.getChild("Dali")
pintura.texture(cam,"art04")
For example in this code i want to show in a painting what is happening in scene 2.
And in scene 2 i load artoolkit, but i can only show the video and not the scene 2 or the subwindow of the scene 2 or the viewpoint that is on the scene 2.
Help if someone know how to resolve this.
import viz
viz.go()
subWindow = viz.addWindow()
subView = viz.addView()
subView.setScene(2)
subWindow.viewpoint(subView)
#subWindow.visible(0) #doesn't show the subwindow
#Add ARToolkit extension
ar = viz.add('artoolkit.dle')
video = viz.add('VideoCamera.dle')
cam = video.addWebcam()
#Create camera using first available webcam
camera = ar.addCamera(texture=cam,param=None,flipVertical=F alse,thresh=None,globalScale=None,window=subWindow )
#Create marker from pattern file
marker = camera.addMatrixMarker(3,width=1000)
#Add logo model
logo = viz.add("logo.ive",viz.WORLD, 2)
#Link logo model to marker sensor
viz.link(marker,logo)
galeria = viz.add("gallery.ive")
pintura = galeria.getChild("Dali")
pintura.texture(cam,"art04")