Code Monkey home page Code Monkey logo

osg-intersectors-example's Introduction

Line, point and virtual plane intersectors using C++11 and OpenSceneGraph

Build Status

Intersectors example: screenshots

This is an example project that demonstrates the work of three types of intersectors: line, point and virtual plane. While the line and point intersectors are based on standard OSG intersector, the virtual plane intersector utilizes ray casting algorithm - when the intersection is calculated between the ray and a virtual plane.

Requirements

  • Compiler that supports C++11, e.g., GCC-4.8
  • OpenSceneGraph library (>=3.4.0)
  • CMake (>= 2.8.11)

Intersectors

The project is composed of two wire rectangles in two different 3D planes. User can select each of the wires by hovering above them and then drag the wire outline by dragging the corresponding corner point.

Each intersector is responsible for one part:

  1. Line intersector is used to determine over what wire the mouse is hovering. Based on the intersection result, that wire gets "selected" which is depicted by wire's color change. Magenta color is used to denote the line intersector is in action.

  2. Point intersector is used to determine whether a mouse is hovering over any point of the wire or not. If it is hovering, that point gets "selected" (depicted as color change) and it also enables point dragging in case if mouse was pushed. Bright green color for a point geometry is used to denote the intersector is in action.

  3. Virtual plane intersector is used to determine the intersection between the ray which is cast from the current camera view and virtual plane which contains the selected wire. This intersector is used for dragging functionality and helps to determine the new position of the drag point in its 3D plane. Yellow color is used for a point geometry and a for a part of a line geometry to denote the virtual plane intersector is in action.

osg-intersectors-example's People

Contributors

vicrucann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.