Skip to content

Commit

Permalink
Refactor triangle calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
casensiom committed Nov 2, 2023
1 parent 56ef45a commit a72f509
Show file tree
Hide file tree
Showing 6 changed files with 1,168 additions and 1,175 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/
build/
build-win/
40 changes: 20 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
cmake_minimum_required(VERSION 3.16)

project(metaball)
set(CMAKE_C_STANDARD 99)
# set(CMAKE_C_STANDARD_REQUIRED TRUE)

# raylib
find_package(raylib QUIET)
if (NOT raylib_FOUND)
include(FetchContent)
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 4.5.0
)
FetchContent_MakeAvailable(raylib)
endif()

message(STATUS "PROJECT_NAME: ${PROJECT_NAME}")
add_executable(${PROJECT_NAME} metaball.c marching_cube.h)
cmake_minimum_required(VERSION 3.16)

project(metaball)
set(CMAKE_C_STANDARD 99)
# set(CMAKE_C_STANDARD_REQUIRED TRUE)

# raylib
find_package(raylib QUIET)
if (NOT raylib_FOUND)
include(FetchContent)
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 4.5.0
)
FetchContent_MakeAvailable(raylib)
endif()

message(STATUS "PROJECT_NAME: ${PROJECT_NAME}")
add_executable(${PROJECT_NAME} metaball.c marching_cube.h)
target_link_libraries(${PROJECT_NAME} PUBLIC raylib)
40 changes: 20 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2023 Carlos Asensio Martinez <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
MIT License
Copyright (c) 2023 Carlos Asensio Martinez <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Metaballs
![Thumbnail](./thumbnail.png)

## Description

This proyect builds a metaball in pure C, uses raylib to render it.

There are optimizations to be done.

## TODO

- ~~Iteration~~. Added a method to visit only valid neighbors.
- ~~Compute the edge values only once~~. A rudimentary cache system is included.
- ~~Add color~~. Added color per ball.
- Add texture mapping.
- Clean code, separate voxel calculation and render code.
- Control, add mouse and keyboard control.
# Metaballs
![Thumbnail](./thumbnail.png)

## Description

This proyect builds a metaball in pure C, uses raylib to render it.

There are optimizations to be done.

## TODO

- ~~Iteration~~. Added a method to visit only valid neighbors.
- ~~Compute the edge values only once~~. A rudimentary cache system is included.
- ~~Add color~~. Added color per ball.
- Add texture mapping.
- Clean code, separate voxel calculation and render code.
- Control, add mouse and keyboard control.
Loading

0 comments on commit a72f509

Please sign in to comment.