View Single Post
  #1  
Old 01-04-2016, 08:06 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
3D text oculus for right to left languages

Hi all,
I'm trying to write instructions for participants in my experiment and having a problem with it using oculus due to two main things:
1.In my country we write from right to left - with vizinfo it works perfectly for scripts without oculus module but when i'm trying to do the same with oculus as display screen (direct display) i can see a double panel in my pc screen but not in the oculus.

Here is the relevant part of my code:
import viz
import oculus
import sys
import vizinfo

viz.setMultiSample(4)
viz.go()
viz.collision(viz.ON)

hmd=oculus.Rift()

# Setup Oculus Rift HMD
hmd = oculus.Rift()
if not hmd.getSensor():
sys.exit('Oculus Rift not detected')

# Go fullscreen if HMD is in desktop display mode
if hmd.getSensor().getDisplayMode() == oculus.DISPLAY_DESKTOP:
viz.window.setFullscreen(True)

#add model
viz.addChild('watermazeBlack1a.osgb')

#enable right-to-left languages:
viz.setOption('viz.text.bidirectional', 1)

#Add vizinfo panel to display instructions
taskInstruction= """ 7 rows of instructions """

info = vizinfo.add('')
infotxt = info.add(viz.TEXT3D,taskInstruction)
infotxt.fontSize(75)
infotxt.alignment(viz.ALIGN_RIGHT_TOP)

I tried to align to center but that didn't help.

2) Font size is small or the text being cut in the middle -
If i'm using hmd=oculus.Rift()
hmd.addMessagePanel(taskInstruction)
the text is being cut in the middle (tried to change position with hmd.assMessagePanel(taskInstruction,pos=(x,y,z)) with no success and no success with
panel=hmd.assMessagePanel(taskInstruction,pos=(x,y ,z))
panel.fontSize(different font size numbers).

The gui canvas present all but the font size is small
# Create canvas for display UI to user
canvas = viz.addGUICanvas()

# Setup events to toggle UI
#vizact.onkeydown(' ', canvas.visible, viz.TOGGLE)

# Add info panel with instructions and controls
panel = vizinfo.InfoPanel(taskInstruction, title=' ', key=' ', icon=False, align=viz.ALIGN_CENTER, parent=canvas,fontSize=30)

My problem with the gui canvas that it represnt the instructions from left to right which is wired reading it for right to left people.

I would really appreciate some help with it.

Have a wonderfull week and sorry for the long message.
Reply With Quote