WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Slider Assistance (https://forum.worldviz.com/showthread.php?t=4237)

new_horizon 05-14-2012 05:17 AM

Slider Assistance
 
Hi All,

I'm currently working on incorporating a slider into my work.

A few questions...

1) Is there a way of labelling different areas of the slider for the user? I have already specified the different intervals in the code.

2) Is there a way of outputing the slider value from the code? So in trial 1 for instance, where did the user move the slider to when prompted.

Thanks

Jeff 05-14-2012 06:48 AM

1) Do you want labels above or below the slider? If so, you can create text objects and position them at those intervals.

2)Register a callback function for the slider event using vizact.onslider:
Code:

import viz
viz.go()

slider = viz.addSlider(pos=[0.5,0.5,0])
def sliderChanged( pos ):
    print pos
vizact.onslider( slider, sliderChanged )


new_horizon 05-14-2012 07:30 AM

Hi Jeff,

Thanks for your prompt response.

I have been trying this method and it does not seem to allow me to register the slider position as a variable for an output.

How can I assign the "pos" value to a variable? For instance, "slidepos"?

Thanks

Jeff 05-16-2012 07:32 AM

I'm not sure I understand the question. Can you post some example code that shows what you are trying to do?


All times are GMT -7. The time now is 06:38 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC