How to add NPCs with SightLab VR for Vizard

Опубликовано: 02 Ноябрь 2024
на канале: worldviz
81
3

#Avatars #SightLab #VRexperiment

Avatar agents or NPCs (non-player characters) are avatars in the scene that don't represent an actual user, but rather an agent in the scene that is controlled by code or AI and can act out scenes or interact with users.

Here are the steps on how to add one to your SightLab experiment

To learn more about SightLab and how it can be used to generate VR experiments for your research contact [email protected] or visit https://www.worldviz.com/virtual-real...

For more information see this page:
https://sightlab.worldviz.com/example...

To try a demo of SightLab and Vizard
https://www.worldviz.com/request-sigh...

Link to this example (Also located in SightLab- ExampleScripts- Adding_Avatar_Agents)
https://drive.google.com/file/d/1_OEV...

00:00 Intro
00:25 Open Environment in Inspector
01:10 Place StandInAvatar in Scene
02:00 Opening Avatar in Inspector
02:44 Easy Version: Adding code to SightLab Script
04:52 Example Run of Script
05:23 Custom Version: Adding code to SightLab Script
06:10 Avatar Libraries and Animation Websites
06:38 Outro

#import necessary modules
import viz, vizfx
from utils import sightlab
from utils import avatarPlacer

#set GUI to 0 if not using SightLab GUI
sightlab.is_GUI = 0

#Set environment
env = vizfx.addChild('utils/resources/environment/ShowRoom_standin_avatar.osgb')
sightlab.objects.append(env)

#Add avatar and give path to your avatar
avatar =vizfx.addAvatar('utils/resources/avatar/full_body/RocketBox_Male1.osgb')

#Collect eye tracking data on avatar
sightlab.gazeObjectsDict = {'avatar':avatar}

#run sightlab experiment
import viztask
def sightLabExperiment():
yield viztask.waitKeyDown(' ')

#Place avatar, name of environment model, name of avatar, name of standIn avatar
avatarPlacer.place(env, avatar, 'avatarStandin')
#set Avatar animation state. To see all animations available open avatar in Inspector
avatar.state(1)

yield viztask.waitKeyDown(' ')

viztask.schedule(sightlab.experiment)
viztask.schedule(sightLabExperiment)