random walk in piazza environment
hi,
I would like to generate a random walk actions for the avatar in the piazza environment. I want the avatar to walk around the environment by itself (without pressing any key) and to perform some actions when it sees a red sphere. I have tried to write some code, but the avatar is moving around an oval. I am really stuck .. I don't know how to do it. this is the code: Code:
import viz your support is highly appreciated |
I have posted the wrong code. so plz ignore it. below is the right code.
I managed to simulate an avatar walking randomly. however, I wanted the avatar to pick up the cellphone when he reaches the red sphere. I have the code for that but I did not know how to do it in a simulated way (without pressing any key) this is the code that I am working on: Code:
import viz |
Simply add
Code:
avatar.execute(15) |
thanks it worked.
I have another question. I replaced the avatar with the steve module and I added the move to action to the module, but I got this error: player_matrix.aaddAction(walks) AttributeError: 'Transform' object has no attribute 'addAction' how can I simulate the movement of the steve as I did with the avatar in the code provided above? thanks. |
You cannot add an action to a matrix. You can add an action to an avatar. Look carefully how you named the 3D-model of steve, and add the action to that model. That should solve your problem.
And there was a type in your addaction command, it was spelled aaddaction. |
thanks it worked. however, I want to c what the steve module sees infront of him (what he is looking at).
I want it to be in this way as reflected in the upper right view: this is the code: Code:
import viz btw, I commented the "add action" . thanx |
Not sure if this will work, but you could try:
Code:
viz.link(player_matrix, RearView) |
it did not work.
what is happening know is that the movement of the steve module is linked with the mainview. so, when I move the mouse, the representation of the steve module moves as well. basically what I want is to make the movement of Steve in a random way instead linking it with a mouse. this is done by the moveTo action. but, I want the user feel as if he is the one who is moving. I want the metal head cover to appear in the to right screen as it is the case for the mouse movement. I hope it is clear. thanx. |
All times are GMT -7. The time now is 09:41 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC