WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-11-2009, 08:51 PM
nlfrnassimi nlfrnassimi is offline
Member
 
Join Date: Feb 2009
Posts: 37
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)
Reply With Quote
 

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
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


All times are GMT -7. The time now is 06:11 AM.


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