Skip to content

Haskell scene graph library, targeting OpenGL and Vulkan

License

Notifications You must be signed in to change notification settings

Izzimach/fomorian

Repository files navigation

Fomorian is a Haskell library that lets you produce 3D graphics by manipulating a scene graph using either OpenGL or Vulkan.

for an example here is a test scene graph from the Sample.hs file

testScene3d :: SceneGraph NeutralSceneTarget DefaultDrawFrameParams 
testScene3d = neutral3DSceneRoot $
                perspectiveProject config $
                  autoAspect $
                    cameraLookAt (V3 5 10 0) (V3 0 0 0) (V3 0 0 1) $ 
                      group [
                        scale3d (V3 2 2 2) someCube,
                        translate3d (V3 3 0 0) $ spin3d (V3 0.7071 0.7071 0) 2 someCube
                        ]
  where
    config = PerspectiveProject  1.2 {-fov-} 1.0 {-aspect-} 0.1 {-near plane-} 1000 {-far plane-}

    someCube :: (DrawReq NeutralSceneTarget dr) => SceneGraph NeutralSceneTarget dr
    someCube = wavefrontMesh "unlit3d" "testcube.obj" ["sad-crab.png"]

This produces the display: Sample pic

to run the example install stack then:

stack build
stack exec example

About

Haskell scene graph library, targeting OpenGL and Vulkan

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages