#1
|
|||
|
|||
Model moves with Vizconnect
import viz
import vizact import vizconnect # start the vizconnect session stored in the given directory vizconnect.go("HTC_Config.py") vizconnect.getTransport('main_transport') oriMode = vizconnect.VIEWPOINT_MATCH_DISPLAY posMode = vizconnect.VIEWPOINT_MATCH_FEET current_pos=[-53.32425, -0.78460, -29.09994] vp=vizconnect.addViewpoint( pos=current_pos, posMode=posMode, oriMode=oriMode, constant=False, ) mylight = viz.addSpotLight(spread=180, pos=(10, 100, 0)) mylight.intensity(100) vp.add(vizconnect.getDisplay()) vizconnect.resetViewpoints() # add an environment candela = viz.add('foo.osgb') viz.add('tut_ground.wrl') view = viz.MainView viz.clearcolor(viz.SKYBLUE) SPEED = 12.0 MODE = viz.SPEED transport = vizconnect.getTransport('main_transport') viz.link(transport.getNode3d(), candela) viz.MainView.move([0,0,-6]) def gotoViewPointAmeniteis(pos): ........global vp ........action = vizact.goto(pos,SPEED,MODE,pivot=vizconnect.getVie wpointDict()) ........vizconnect.getTransport('main_transport'). getNode3d().runAction(action) def move(): ........if viz.key.isDown(viz.KEY_UP): ................print 'key is up' ................#view.move([0,0,MOVE_SPEED*viz.elapsed()],viz.BODY_ORI ................global current_pos ................current_pos[2] += 5 ................gotoViewPointAmeniteis(current_pos ) ........elif viz.key.isDown(viz.KEY_DOWN): ................print 'key is down' ................#view.move([0,0,-MOVE_SPEED*viz.elapsed()],viz.BODY_ORI ................current_pos[2] -= 5 ................gotoViewPointAmeniteis(current_pos ) vizact.ontimer(0, move) The script I have attempts to move the user throughout the model, however what I have learned is happening is that the model that is the main environment is moving with the user, instead of being stationary. I learned this because of the spotlight. The spotlight is stationary while the rest of the model moves. How can I lock the model in place so the user can move about? I am also using an HTC Vive and would like to use the wands to move, but for now I am content with using the keyboard since it's simpler. |
#2
|
|||
|
|||
Hi ArshBot,
In the above code you have written which links the model and the transports node(containing viewpoint) that is :viz.link(transport.getNode3d(), candela). That the reason user along with the model is moving. Pls remove this line of code or comment it. To understand better on using transports in vizconnect,pls refer tutorials from documentation on Inputs and Transports from Vizconnect Section. Link: http://docs.worldviz.com/vizard/vizc...navigators.htm |
#3
|
|||
|
|||
Thanks! That did the job!
|
Tags |
movement, vive, vizconnect |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Switching between input devices setup in vizconnect and not using vizconnect | JB_HP_Viz | Vizard | 1 | 01-20-2015 06:19 AM |
Vizconnect Save As Dialog | Jeff | Vizard | 0 | 05-01-2014 10:45 AM |
Accesing different parts of model | pankaj bansal | Vizard | 1 | 12-30-2012 11:10 PM |
3ds Exported .IVE Model mirrors movement of Mainview | Felix | Vizard | 9 | 05-18-2012 10:17 AM |
Change model alpha and memory leak | hosier | Vizard | 2 | 06-25-2009 11:55 AM |