Changeset 37422 in project


Ignore:
Timestamp:
03/19/19 10:48:39 (17 months ago)
Author:
Kooda
Message:

Document hyperscene for CHICKEN 5

File:
1 copied

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/hyperscene

    r37394 r37422  
     1
    12== Hyperscene
    23[[toc:]]
    34Hyperscene is a scene library – made for placing objects in a shared world for the purpose of rendering – for CHICKEN Scheme. Hyperscene features a scene graph, cameras with a variety of movement types, frustum culling based on an configurable spatial partitioning system, and a lighting extension. Hyperscene is target agnostic: it is not bound to any particular rendering target and should work equally well for curses, OpenGL, and anything in between.
    45
    5 Hyperscene is a set of bindings to the [[https://github.com/AlexCharlton/Hyperscene|Hyperscene C library]]. It’s fairly rough around the edges for general use in Scheme. It should generally be wrapped in order to make it more palatable. [[http://wiki.call-cc.org/eggref/4/hypergiant|Hypergiant]] is one such library that wraps Hyperscene for use with OpenGL.
    6 
    7 Some rendering options are defined at compile time. See {{render-camera}} for details.
     6Hyperscene is a set of bindings to the [[https://github.com/AlexCharlton/Hyperscene|Hyperscene C library]]. It’s fairly rough around the edges for general use in Scheme. It should generally be wrapped in order to make it more palatable. [[https://wiki.call-cc.org/egg/hypergiant|Hypergiant]] is one such library that wraps Hyperscene for use with OpenGL.
     7
     8Some rendering options are defined at compile time. See {{render-camera}} for details. '''Important note, in version 0.4.0 (for CHICKEN 5), these options aren't available anymore and will be added back when CHICKEN 5.1 is out'''
    89
    910
     
    9091<procedure> (node-rotation NODE)</procedure>
    9192
    92 Return a pointer to the node’s quaternion {{(x y z w)}} that describes the rotation of the node relative to its parent. Modifying this quaternion (e.g. with gl-math’s imperative [[http://wiki.call-cc.org/eggref/4/gl-math#quaternion-operations|quaternion functions]]) will rotate the node. Make sure to call {{node-needs-update!}} after modifying the returned quaternion.
     93Return a pointer to the node’s quaternion {{(x y z w)}} that describes the rotation of the node relative to its parent. Modifying this quaternion (e.g. with gl-math’s imperative [[https://wiki.call-cc.org/egg/gl-math#quaternion-operations|quaternion functions]]) will rotate the node. Make sure to call {{node-needs-update!}} after modifying the returned quaternion.
    9394
    9495<procedure> (node-needs-update! NODE)</procedure>
     
    120121<procedure> (add-pipeline PRE-RENDER RENDER POST-RENDER [ALPHA])</procedure>
    121122
    122 Create a new pipeline with the given [[http://wiki.call-cc.org/man/4/Callbacks|callbacks]] (or pointers to pure C functions). {{ALPHA?}} indicates whether or not the pipeline can render any transparent elements (defaults to {{#f}}).
     123Create a new pipeline with the given [[https://wiki.call-cc.org/man/5/Module%20(chicken%20foreign)#callbacks|callbacks]] (or pointers to pure C functions). {{ALPHA?}} indicates whether or not the pipeline can render any transparent elements (defaults to {{#f}}).
    123124
    124125<procedure> (delete-pipeline PIPELINE)</procedure>
     
    128129
    129130==== Cameras
    130 Cameras, aside from having an orientation and position within a given scene, have two main properties. Their ''type'' is the sort of [[http://en.wikipedia.org/wiki/Graphical_projection|projection]] that the camera uses: either orthographic or perspective. The ''style'' of the camera indicates the way in which the camera can be moved (see [[#movement-and-rotation|Movement and rotation]] for details of each function):
     131Cameras, aside from having an orientation and position within a given scene, have two main properties. Their ''type'' is the sort of [[https://en.wikipedia.org/wiki/Graphical_projection|projection]] that the camera uses: either orthographic or perspective. The ''style'' of the camera indicates the way in which the camera can be moved (see [[#movement-and-rotation|Movement and rotation]] for details of each function):
    131132
    132133* A ''position'' camera is one where the position and rotation of the camera is explicitly set. Movement functions: {{move-camera!}}, {{set-camera-position!}}, {{camera-rotation}}.
     
    217218<procedure> (camera-rotation CAMERA)</procedure>
    218219
    219 Return a pointer to the node’s quaternion {{(x y z w)}} that describes the rotation of the camera. Modifying this quaternion (e.g. with gl-math’s imperative [[http://wiki.call-cc.org/eggref/4/gl-math#quaternion-operations|quaternion functions]]) will rotate ''position'' cameras. The returned quaternion must not be modified for any other camera styles.
     220Return a pointer to the node’s quaternion {{(x y z w)}} that describes the rotation of the camera. Modifying this quaternion (e.g. with gl-math’s imperative [[https://wiki.call-cc.org/egg/gl-math#quaternion-operations|quaternion functions]]) will rotate ''position'' cameras. The returned quaternion must not be modified for any other camera styles.
    220221
    221222<procedure> (camera-look-at! CAMERA POINT)</procedure>
     
    315316
    316317==== Spatial Partitioning
    317 Hyperscene only renders nodes that are within the bounds of a camera (i.e. it performs view frustum culling). In order for it to efficiently sort through the nodes, a [[http://en.wikipedia.org/wiki/Space_partitioning|spatial partitioning]] system is used. Different spatial partitioning systems can be used on a per-scene basis.
     318Hyperscene only renders nodes that are within the bounds of a camera (i.e. it performs view frustum culling). In order for it to efficiently sort through the nodes, a [[https://en.wikipedia.org/wiki/Space_partitioning|spatial partitioning]] system is used. Different spatial partitioning systems can be used on a per-scene basis.
    318319
    319320If you wish to write a new partition interface, see the [[https://github.com/AlexCharlton/Hyperscene|Hyperscene]] documentation.
     
    445446
    446447=== Examples
    447 See the [[https://github.com/AlexCharlton/hyperscene-chicken/tree/master/examples|examples directory]] to see Hyperscene in action.
     448See the [[https://www.upyum.com/cgit.cgi/hyperscene-chicken/tree/examples|examples directory]] to see Hyperscene in action.
    448449
    449450
    450451=== Version history
     452
     453==== Version 0.4.0
     45419 March 2019
     455
     456* Maintenance given to [[/users/kooda|Kooda]]
     457* Port to CHICKEN 5
     458
    451459
    452460==== Version 0.3.0
     
    471479
    472480=== Source repository
    473 Source available on [[https://github.com/AlexCharlton/hyperscene-chicken|GitHub]].
    474 
    475 Bug reports and patches welcome! Bugs can be reported via GitHub or to alex.n.charlton at gmail.
    476 
    477 
    478 === Author
     481Source available [[https://www.upyum.com/cgit.cgi/hyperscene-chicken/|here]].
     482
     483Bug reports and patches welcome! Bugs can be reported to kooda@upyum.com
     484
     485
     486=== Authors
    479487Alex Charlton
     488
     489Adrien (Kooda) Ramos
    480490
    481491
    482492=== License
    483493BSD
     494
Note: See TracChangeset for help on using the changeset viewer.