PDA

View Full Version : temporary 3DText


M@rcello
08-29-2016, 03:07 AM
Hello to everyone, I need to build a function that show a 3d text for one second every time that the space bar is pressed.

EX:

def show():
Text=viz.addText3D('Hello world', pos,color .....)
vizact.onkeydown(' ',show)


The 'Hello world' has to disappear after one second.

Thanks for your help!!

rajnishv
08-29-2016, 04:39 AM
Hi Marcello,
You can use on vizact.onkeydown(' ',show) to call a function that displays the 3D Text at every one second.

request you to pls see to the artice on Timer Events and Fuctions in the documentation
Steps:

-start the timer on button event usign startTimer
Refer Link:
http://docs.worldviz.com/vizard/comm...starttimer.htm

-Timer will be activated for every one second using ontimer
Refer Link:
http://docs.worldviz.com/vizard/comm...ct/ontimer.htm

-Then last call kill timer after one seconds get over
Refer Link:
http://docs.worldviz.com/vizard/comm.../killtimer.htm

After kill timer then again listen for button event. and folow the steps as mentioned above.

Thanx&Regards
Mr.Rajnish Vishwakarma
Mobile,AR,VR
Xenium Digital Pvt ltd,Mumbai

M@rcello
08-29-2016, 04:50 AM
hi and thanks for your interest.
The links you have sent me are not available anymore.

Anyway i know how to use the command vizact.ontimer, the problem is that i don't know how to remove the text after the first time it comes out!

rajnishv
08-29-2016, 04:55 AM
Refer doumentation and :

Use startTimer and killTimer in co-ordination with ontimer



Thanx&Regards
Mr.Rajnish Vishwakarma
Mobile,AR,VR
Xenium Digital Pvt ltd,Mumbai

istarion
08-29-2016, 05:10 AM
Removing the text is a simple call to remove if you don't need this Text instance again:

#display text
Text=viz.addText3D('Hello world', pos,color .....)

#remove text
Text.remove()


If you want to hide/show the same text multiple times us this:

#create/display text
Text=viz.addText3D('Hello world', pos,color .....)

#toggle visibility with these
Text.visible(viz.OFF)
Text.visible(viz.ON)

rajnishv
08-30-2016, 05:59 AM
Hi M@rcello,
PFA the attachment of the script which i have made for you.
The script shows text for every one second when a spacebar is pressed.
Its a simple script.
Pls go through it.



Thanx&Regards
Mr.Rajnish Vishwakarma
Mobile,AR,VR
Xenium Digital Pvt ltd,Mumbai

M@rcello
08-31-2016, 12:46 AM
Thank you very much Rajnishv, i didn't thought to the chance to create an indipendent function to disable the visibility of the Text 'a priori'.

Well done, and many thanks

rajnishv
09-03-2016, 12:54 AM
Thanx Marcello:

Also try to use startTimer in co ordination with the vizact.ontimer() ot vizact.ontimer2() function to create your own function..


Thanx&Regards
Mr.Rajnish Vishwakarma
Mobile,AR,VR
Xenium Digital Pvt ltd,Mumbai