项目作者: binarytrails

项目描述 :
Generating 3D shapes by Sweeping Splines
高级语言: C++
项目地址: git://github.com/binarytrails/splines.git
创建时间: 2017-03-01T00:19:10Z
项目社区:https://github.com/binarytrails/splines

开源协议:MIT License

下载


Sweeping Splines

This project is generating 3D shapes by drawing splines with modern OpenGL in C++. These polygon curves are used as input for translational or rotational sweeping to create three dimentional shapes. A user can explore these artifacts using controls to zoom in, move around and rotate the model.


More artsy shapes on rotation-wo-radians branch :

Setup

It was tested on Arch Linux.

Dependencies

  1. # Arch Linux
  2. sudo pacman -S glew glm glfw-x11 mesa-demos

Compiling:

  1. make arch # Arch Linux
  2. make linux # GNU / Linux (general)

Usage

An example command:

  1. ./run.sh <name>

Controls

  1. [Splines Drawing]
  2. mouse-l marks control points in the window
  3. scroll zoom in / zoom out (z)
  4. enter x 1 generates spline
  5. enter x 2 goes to next spline
  6. s generate spline
  7. l switch to previous spline
  8. r switch to next spline
  9. c print cursor coordinates
  10. backspace resets the application
  11. [3D Shape]
  12. mouse-l + move rotate on (x, y)
  13. arrows rotate on (x, y)
  14. w move up
  15. s move down
  16. a move left
  17. d move right
  18. t display triangles
  19. l display lines
  20. p display points

Roadmap

Requierements

  • User decides whether to have a translational “T” or rotational sweep “R” (through console)

  • The user then marks control points in the window with the mouse (assume XZ plane, Y=0). The X and Z coordinates of each point should then relate to the window coordinates where the user has clicked.

  • User can then press “Enter” which computes and draws the spline.

    • If the user selected translational sweep, then repeat steps 2-3 for the second set of control points resulting in two separate splines (this time assume XY plane, Z=0). The X and Y coordinates of each point should then relate to the window coordinates where the user has clicked.
  • Write the points of the resulting spline/s to an output file. The output file should have the same description format as Assignment #1.

  • Load the output file in Assignment #1 and generate smooth surfaces based on the input splines.

Sub-requierements

  • Create a GLFW window of size 800x800 with double buffering support

  • The application should handle window resize events

  • Use an orthographic projection for simplicity

  • Splines : Generate indices to draw lines (l)

  • Splines : don’t add artificial points before 0 & after n - 1 points and make those red

Extra

  • Compute the sweep surfaces

  • Use the subdivision algorithm taking into account the curvature (rather than distance) for drawing the curve

Authors

Vsevolod (Seva) Ivanov - seva@tumahn.net