WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   view problem (https://forum.worldviz.com/showthread.php?t=1896)

nlfrnassimi 03-10-2009 08:51 PM

view problem
 
I have imported an avatar and applied a keyboard key to animate it. my problem is that I want to make my view as first person point of view. I've also been able to connect my view to the avatar but the problem is I can see the avatar's head, I want my camera to be beside him moving with him.
Please help.

This is my code:

import viz

viz.go()

viz.add('tut_ground.wrl')

character = viz.add('vcc_male.cfg') # Add a CAL3D based avatar
character.state(1) # Activate the walking state

def characterWalk (key):
if key == viz.KEY_KP_RIGHT:
character.state(2)
walk = vizact.walkTo([5,0,0],1)
character.addAction(walk)


viz.callback(viz.KEYBOARD_EVENT, characterWalk)


viewLink = viz.link( character, viz.MainView, enabled = True )
viewLink.setDstFlag(viz.LINK_HEAD)

nlfrnassimi 03-10-2009 09:24 PM

I have fixed this problem but now I have another problem. I want to press a certain key and be able to look left and right without moving. I was able to do it with view but now that my view is linked to the character I can't move it. Please help me!!

Jeff 03-11-2009 02:36 PM

You can set the mask of the link so it only affects the position of the destination object, then you'll still be able to change the viewpoint orientation
Code:

viewLink = viz.link(character,viz.MainView,mask=viz.LINK_POS)
In the future please use the code tags when you post code to preserve the indentation

nlfrnassimi 03-11-2009 08:33 PM

thanks and sorry for the codes.


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

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