Home > Uncategorized > Yampa and OpenGL

Yampa and OpenGL

In order to visualize behaviors/signals I needed Yampa and OpenGL to work together. Mun Hon Cheong has done this in his thesis Functional Programming and 3D Games. The source code for his game Frag is available here. After a bit of struggling I got my sine oscillator to animate the scale of an OpenGL sphere.

Animated sphere

Sorry about the video quality. The method that Mun Hon Cheong describes avoids using Yampas reactimate for running things (since there is no way to incorporate it into the glut mainloop). Instead, he suggests using reactinit and react. This works even though I find it ugly that things are rendered in the idle callback and not in the draw callback. A big step forward though – and many thanks to Mun Hon Cheong for his excellent work. My source code is available here and the file of interest is yampa_and_gfx.hs.

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: