Ejemplo n.º 1
0
#
from math import *
from euclid import *
from omega import *
from cyclops import *
from omegaToolkit import *
from pyparsing import *

import random

#####################################################################################################################
# ADD THIS TO USE CAVEVOC
# The init function tells CAVEVOC to call the function ParseVoiceCommand whenever
# speech is translated.
from cavevoc import cavevoc
cavevoc.init("ParseVoiceCommand")

g_recogTextNode = None


def ShowRecogText(confid, textstr):
    global g_recogTextNode
    text = Text3D.create('neuropol.ttf', 0.05, str(confid) + "\n" + textstr)
    min = text.getBoundMinimum()
    max = text.getBoundMaximum()
    size = max - min

    text.setPosition(getDefaultCamera().getHeadOffset() +
                     Vector3(-size.x / 2.0, -0.5 + size.y / 2, -2))
    text.setFontResolution(120)
    text.setColor(Color('white'))
Ejemplo n.º 2
0
# to find out how to use it in your own programs.
#
from math import *
from euclid import *
from omega import *
from cyclops import *
from omegaToolkit import *

import random

########################################################################
# ADD THIS TO USE CAVEVOC
# The init function tells CAVEVOC to call the function MakeText whenever
# speech is translated.
from cavevoc import cavevoc
cavevoc.init("MakeText")

########################################################################
# Make a scene.

g_scene = getSceneManager()

# Create a light
g_light = Light.create()
g_light.setColor(Color("#FFFFFF"))
g_light.setAmbient(Color("#303030"))
g_light.setPosition(Vector3(-5,5,5))
g_light.setEnabled(True)


Ejemplo n.º 3
0
# to find out how to use it in your own programs.
#
from math import *
from euclid import *
from omega import *
from cyclops import *
from omegaToolkit import *

import random

########################################################################
# ADD THIS TO USE CAVEVOC
# The init function tells CAVEVOC to call the function MakeText whenever
# speech is translated.
from cavevoc import cavevoc
cavevoc.init("MakeText")

########################################################################
# Make a scene.

g_scene = getSceneManager()

# Create a light
g_light = Light.create()
g_light.setColor(Color("#FFFFFF"))
g_light.setAmbient(Color("#303030"))
g_light.setPosition(Vector3(-5, 5, 5))
g_light.setEnabled(True)

########################################################################
# Callback function called by cavevoc when text is received from the recognizer.
Ejemplo n.º 4
0
#
from math import *
from euclid import *
from omega import *
from cyclops import *
from omegaToolkit import *
from pyparsing import *

import random

#####################################################################################################################
# ADD THIS TO USE CAVEVOC
# The init function tells CAVEVOC to call the function ParseVoiceCommand whenever
# speech is translated.
from cavevoc import cavevoc
cavevoc.init("ParseVoiceCommand")

g_recogTextNode = None

def ShowRecogText(confid,textstr):
	global g_recogTextNode
	text = Text3D.create('neuropol.ttf',0.05,str(confid)+"\n"+textstr)
	min=text.getBoundMinimum()
	max=text.getBoundMaximum()
	size = max-min
		
	text.setPosition(getDefaultCamera().getHeadOffset() + Vector3(-size.x/2.0,-0.5+size.y/2,-2))
	text.setFontResolution(120)
	text.setColor(Color('white'))
	if (g_recogTextNode != None):
		getDefaultCamera().removeChildByRef(g_recogTextNode)