WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Best Way to set up wii cursors across 2 windows (https://forum.worldviz.com/showthread.php?t=1396)

shivanangel 03-13-2008 10:35 AM

Best Way to set up wii cursors across 2 windows
 
Hello again,

I have been looking through the help file again and before I go and completely do this wrong I figured I'd ask you and see what your advice would be.

I want to create a similar setup to the wiimote demo you provide in vizard, however I have split the screen into 2 windows, a top and bottom ( think split screen mode in games). I want the wiimote1 to pertain to the top and wiimote2 cursor on the bottom window. Right now, using the old code produces two cursors in both windows by writing directly to the screen.

Do I have to set up two separate scenes to make this work? Or is there a better way?

By setting up two scenes, do I have to manually change each characters coordinates across both, since from what I read in the help file about it one scene is independent from the other in terms of future changes.

Thanks,
George

farshizzo 03-13-2008 11:24 AM

Add the cursor objects to the viz.ORTHO layer. Each window has its own viz.ORTHO layer, which is similar to viz.SCREEN, except that position values are in pixel units, instead of normalized units. Here is some sample code:
Code:

#Add a pointer to the screen
cursor = viz.add('arrow.tif')
size = cursor.getSize()
pointer1 = viz.addTexQuad(parent=viz.ORTHO,scene=window1,texture=cursor,scale=size)
pointer2 = viz.addTexQuad(parent=viz.ORTHO,scene=window2,texture=cursor,scale=size)

When updating the position of the pointers from the wiimote, just multiply the wiimote position by the (width,height) of the window.


All times are GMT -7. The time now is 12:23 AM.

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