Skip to content

zhukeshhhh/wireframerenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wireframe Renderer

This repository contains a compact wireframe renderer with two front-ends:

  • render-gui — interactive OpenGL viewer (GLFW + GLAD included as vendor libraries).
  • render-to-file — offline CPU rasterizer that writes a PNG using stb_image_write.

All required GL-related third-party code (GLAD and GLFW) is already included in vendor/ and the project ships with a CMakeLists.txt that builds both targets.


Prerequisites

  • CMake 3.14 or newer.
  • A C++17-capable compiler (g++, clang, MSVC).
  • Functional OpenGL drivers on your machine.

(No external package install is required for GLAD/GLFW; those are built from vendor/.)


Building (recommended with CMake)

From the project root:

# create an out-of-source build directory
# from project root:
mkdir build
cd build
cmake ..
cmake --build .

The CMakeLists.txt already:

  • Builds vendor/glad into a static glad library.
  • Adds vendor/glfw as a subdirectory.
  • Links targets against glad, glfw and OpenGL::GL.

Running

Interactive viewer

./render-gui path/to/model.obj

Controls:

  • Mouse (when cursor is captured) to rotate (FPS-style yaw / pitch).
  • WASD — move camera; SPACE / LCTRL — up / down.
  • ESC toggles cursor capture.
  • Window title displays basic status (verts/edges, camera).

Offline PNG renderer

./render-to-file path/to/model.obj camX camY camZ [proj] [output.png]
  • camX camY camZ — camera position in world space.
  • proj (optional) — persp (default) or ortho.
  • output.png (optional) — filename. The program tries to write into ../result/ and will fall back to the current directory if creation fails. Example:
./render-to-file ../assets/monkey.obj -4 -3 2 ortho monkey.png

Notes & troubleshooting

  • Make sure your GPU drivers support the OpenGL version requested by GLFW on your platform.
  • If CMake fails to find OpenGL, install the platform OpenGL development package (e.g. libgl1-mesa-dev on some Linux distributions).
  • You can find examples in examples folder

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages