WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-20-2017, 08:26 AM
arshbot arshbot is offline
Member
 
Join Date: Mar 2017
Posts: 8
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.
Reply With Quote
  #2  
Old 03-20-2017, 10:57 PM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
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
Reply With Quote
  #3  
Old 03-23-2017, 06:38 AM
arshbot arshbot is offline
Member
 
Join Date: Mar 2017
Posts: 8
Thanks! That did the job!
Reply With Quote
Reply

Tags
movement, vive, vizconnect

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
Switching between input devices setup in vizconnect and not using vizconnect JB_HP_Viz Vizard 1 01-20-2015 05:19 AM
Vizconnect Save As Dialog Jeff Vizard 0 05-01-2014 09:45 AM
Accesing different parts of model pankaj bansal Vizard 1 12-30-2012 10:10 PM
3ds Exported .IVE Model mirrors movement of Mainview Felix Vizard 9 05-18-2012 09:17 AM
Change model alpha and memory leak hosier Vizard 2 06-25-2009 10:55 AM


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


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