#1
|
|||
|
|||
View
I have tried to link my view to my avatar and make it first point of view. I have assigned r key to make avatar and view go to a certain point and also created another view to be able to change my view. I have tried to look side, up and down by pressing certain keys but they don't work properly and another problem is that my animated path (r key ) doesn't work now.
Please take a look at my code. and tell me what are the mistakes that I have made. import viz viz.go() viz.add('tut_ground.wrl') view = viz.MainView character = viz.add('vcc_male.cfg') # Add a CAL3D based avatar character.state(1) # Activate the walking state viewLink = viz.link( character, view) viewLink.setDstFlag( viz.LINK_HEAD) viewLink.preTrans( [-.4, .1, 0] ) vizact.whilekeydown(viz.KEY_UP,character.rotate,1, 0,0,vizact.elapsed(-15),viz.REL_PARENT) vizact.whilekeydown(viz.KEY_DOWN,character.rotate,-1,0,0,vizact.elapsed(-15),viz.REL_PARENT) vizact.whilekeydown(viz.KEY_RIGHT,character.rotate ,0,1,0,vizact.elapsed(15),viz.REL_PARENT) vizact.whilekeydown(viz.KEY_LEFT,character.rotate, 0,1,0,vizact.elapsed(-15),viz.REL_PARENT) def characterWalk (key): if key == 'r': character.state(2) walk = vizact.walkTo([10,0,0],1,45) character.addAction(walk) viz.callback(viz.KEYBOARD_EVENT, characterWalk) secondView = viz.addView() secondView.setPosition(10,2,20) secondView.rotate(220) def anotherView (key): if key == 'v': viz.MainWindow.viewpoint(secondView) viz.callback(viz.KEYBOARD_EVENT, anotherView,priority=1) |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
view problem | nlfrnassimi | Vizard | 3 | 03-11-2009 08:33 PM |
Manipulating Tracker View | Micha | Vizard | 3 | 02-25-2008 10:05 AM |
problem with stereo mode | shivanangel | Vizard | 3 | 10-17-2006 09:58 AM |
Moving view with object | Xliben | Vizard | 2 | 07-25-2005 05:36 PM |
keeping a 3d object in front of the view | tavaksai | Vizard | 1 | 07-07-2004 09:33 AM |