Giter Club home page Giter Club logo

boids's Introduction

boids's People

Contributors

rexim avatar unclechu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

boids's Issues

Steer to mouse position

Pieces

  • #39 Implement ViewPort dragging with mouse
  • #44 Take zoom factor into account while dragging the view
  • #40 Implement Boids following the cursor rule

See how to improve multiline string with qm-interpolated-string

boids/test/TestDataSpec.hs

Lines 92 to 104 in dc49705

where xmlData = unlines [ "<svg xmlns='http://www.w3.org/2000/svg'>"
, " <g id='outer'>"
, " <circle cx='326' cy='155' />"
, " <circle cx='478' cy='419' />"
, " <circle cx='107' cy='449' />"
, " <g id='inner'>"
, " <circle cx='102' cy='152' />"
, " <circle cx='327' cy='246' />"
, " <circle cx='444' cy='358' />"
, " </g>"
, " </g>"
, "</svg>"
]

https://www.stackage.org/package/qm-interpolated-string

Suggested by @unclechu

Improve Vector experience

Introduced in #41
Piece: dfec87ca-77f5-4ad6-a015-81b49929a5a1

This application works with vectors pretty extensively, and functions like addTwoVectors are not really convenient.

Irregular zooming speed

When we are too closed to the boids, the zooming is slow. But when we are zoomed out, the zooming is really fast. The speed of the zooming should be roughly the same on all levels.

Implement steering rules

Split from #5 (comment)

Remaining Work

  • Calculate average position of near boids
  • Steer to the opposite position of near boids

Split

  • #18 Consider nearest boids only within the view
  • #16 Implement Alignment rule
  • #17 Implement Cohesion rule

Simple 2D boids

Just a bunch of boids on 2D that follow the 3 steering rules:

  • Separation: steer to avoid crowding local flockmates
  • Alignment: steer towards the average heading of local flockmates
  • Cohesion: steer to move toward the average position of local flockmates

See http://www.red3d.com/cwr/boids/ for more info

Identity of boids

There are lots of situations where we need the boids to have an identity. We need to research if it makes sense to introduce an identity as the part of the boid state.

Combined Rule

After reviewing https://github.com/skeeto/boids-js I came to conclusion that our implementation has several major flaws right now:

  • Wrap both position of the boid.
  • Average angle is broken. See https://en.wikipedia.org/wiki/Mean_of_circular_quantities
  • Alignment and cohesion rule are applied simultaneously by using mean angle of their targets
  • Alignment rule has roughly 3/4 influence over the cohesion rule
  • Separation rule has the highest priority and override any other rule

Should fix #20

Navigation entity

Introduced in #41
Piece: 22ffd996-8c7f-4bfa-9166-66ddc77858eb

Introduce a separate entity called Navigation which encapsulates the view port and the drag position. All of the functions such as zoomControl and dragControl should work only with Navigation instead of the entire World.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.