Question on using shading & 3D dots

Hi, I'm Chungmin Han,
graduate research assistant in Univ of Texas at Austin,

I'm composing experimental setup that presents visual stimuli inside the mri scanner,
and I need 3D anaglyphic dots having inward-outward, both linear flow in horizontal and vertical
direction,

I've modified DrawDots3DDemo.m provided by PTB, but the shader is compiled as taking xyz vector as speed instead of position, but I need dots to change size in terms of the distance to the observer,

code attached is 3D dots flowing inward-outward, Not using shading, size changes in terms of distance, but it seems like as I increase the number of dots, the computer seems to miss the time stamps, like 382 out of 386.

I need exact timeframe in order to analyze fmri data, how should I improve my code?
and I was looking into modifying the shader file (.vert format) but for this, it seems that I need to
know certain amount of openGL provided structures and internal functions, eventually I will have to
look into that, but before that, I would hugely appreciate expert's advice on this.

Thanks for reading
Best Regards,
Chungmin

--

Chungmin Han

Graduate Research Assistant

The University of Texas at Austin
204 E. Dean Keeton St
ETC 4.134 Rewire lab
Austin TX 78712

Mobile : +1-737-529-4134
Email : cmhan616@...
Your sample code misses the functions actually needed to update your stimulus dot positions, so the sample doesn't run and doesn't help in actually understanding what you want to achieve.

For selecting dot sizes based on distance efficiently you wouldn't compute them in Matlab, but do the calculation in the vertex shader. Specifying dot size to moglDrawDots3D manually is a slow operation - one fixed size per call is fine, variable sizes could easily cause a 10x slowdown.

Apart from that all the warnings and errors PTB prints for what i guess is a Windows-7 dual-display setup suggest that timing, timestamping and therefore skipped frame detection will be unreliable/faulty and performance on that setup will be severely degraded anyway. Iow. you can't use that setup if you care about proper timing.

-mario

XX---In PSYCHTOOLBOX@yahoogroups.com, <cmhan616@...> wrote :

Hi, I'm Chungmin Han,
graduate research assistant in Univ of Texas at Austin, 

I'm composing experimental setup that presents visual stimuli inside the mri scanner, 
and I need 3D anaglyphic dots having inward-outward, both linear flow in horizontal and vertical
direction, 

I've modified DrawDots3DDemo.m provided by PTB, but the shader is compiled as taking xyz vector as speed instead of position, but I need dots to change size in terms of the distance to the observer, 

code attached is 3D dots flowing inward-outward, Not using shading, size changes in terms of distance, but it seems like as I increase the number of dots, the computer seems to miss the time stamps, like 382 out of 386. 

I need exact timeframe in order to analyze fmri data, how should I improve my code? 
and I was looking into modifying the shader file (.vert format) but for this, it seems that I need to 
know certain amount of openGL provided structures and internal functions, eventually I will have to
look into that, but before that, I would hugely appreciate expert's advice on this. 

Thanks for reading
Best Regards,
Chungmin  

--

Chungmin Han

Graduate Research Assistant

The University of Texas at Austin
204 E. Dean Keeton St
ETC 4.134 Rewire lab
Austin TX 78712

Mobile : +1-737-529-4134
Email : cmhan616@...