Skip to content

Commit

Permalink
Add C++ version
Browse files Browse the repository at this point in the history
Minimal source changes. No-content run produces help output.

Compiles, but not level-4 warning clean on MSVC.
  • Loading branch information
hollasch committed Oct 22, 2024
1 parent 7b52312 commit 75511f3
Show file tree
Hide file tree
Showing 50 changed files with 7,900 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ray4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Git Ignore -- ray4

/build/
6 changes: 6 additions & 0 deletions ray4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change Log -- `ray4`
====================================================================================================

# 1.0.0-alpha.1 (in progress)
- First conversion from the original C to C++.

27 changes: 27 additions & 0 deletions ray4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#---------------------------------------------------------------------------------------------------
# CMake Build Configuration for the ray4 4D raytracer
#---------------------------------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.10.0...3.30.5)

set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)

project (ray4 LANGUAGES CXX)

# Source
set ( sources_ray4
src/r4_globals.h
src/r4_hit.cpp
src/r4_image.h
src/r4_io.cpp
src/r4_main.cpp
src/r4_parse.cpp
src/r4_trace.cpp
src/r4_vec.cpp
src/ray4.h
src/vector.h
)

add_executable (ray4 ${sources_ray4})
54 changes: 54 additions & 0 deletions ray4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ray4
====================================================================================================

This is `ray4`, a 4D raytracer I wrote for my master’s thesis in May 1991
([_Four-Space Visualization of 4D Objects_][thesis]).

Ray4 User Manual
-----------------
See the [Ray4 User Manual][] for usage information.


Project Structure
------------------
This project includes the following directories:

| Directory | |
|-------------|---------------------------------------------|
| [craig/][] | Mark Craig contributions |
| distribute/ | Old (now unused) files for FTP distribution |
| inputs.r4/ | Sample input ray4 files |
| src/ | ray4 source code |


Building
---------
This project now builds with CMake, which should allow the code to work on all CMake-supported
platforms. Build from the `/ray4/ray4/` directory.


Example Run
-----------

ray4 -b12 -idots.r4 -odots.icube -a10:11:20 -r78:65:12
r4toiff dots.icube -t


Beta Testers
------------
Thanks to the following beta testers for helping me with this code:

- Greg Aharonian
- Brian Carney
- Mark Craig
- Mark Ferneau
- Marty Ryan

----
Steve Hollasch / [email protected]



[craig/]: craig/README.md
[Ray4 User Manual]: ray4.md
[thesis]: https://hollasch.github.io/ray4/Four-Space_Visualization_of_4D_Objects.html
41 changes: 41 additions & 0 deletions ray4/craig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Mark Craig Contributions
====================================================================================================

NOTE: To convert ray4 image files to SUN rasterfile, you need the PBM graphics package - See below
for info.

`run` and `run2` are sample scripts that can be used to run ray4 in the background. For example
`run dots` will raytrace the dots.r4 input file in the background redirecting all screen output to
the file `temp` and saving the ray4 image file as `dots.icube`.

To convert ray4 image data files to MTV format, use `r4tomtv`. r4tomtv uses the same command line
arguments as r4tosgi. It will create MTV files whose name is of the form:

slice_(data file prefix)_(zplane)

For example: `slice_dots_0` would be the 0 zplane slice of the `dots.icube` file.

To convert an individual MTV file to SUN rasterfile, use `mtvtorast`. For example: `mtvtorast
slice_dots_0` will create the SUN rasterfile named `slice_dots_0.ras`. `screenload slice_dots_0.ras`
will display the image on a SUN.

`convert` will convert all slice MTV files to SUN rasterfile automatically. It also will delete all
MTV slice files if the user responds with "y" to the delete files prompt.

To display an individual MTV file on a SUN screen without saving to a SUN rasterfile, use `display`.
For example: `display slice_dots_0` will convert and display the slice.

Additional information (I don't know if the email addresses are still valid):

**MTV** --
MTV RAYTRACER written by Mark Terrence VandeWettering ([email protected])

**PBM** --
Extended Portable Bitmap Toolkit written by Jef Poskanzer ([email protected])
`{ucbvax, lll-crg, sun!pacbell, apple, hplabs}!well!pokey`

Both available at many anonymous FTP sites.

Mark R. Craig
<br>Florida Institute of Technology
<br>[email protected]
17 changes: 17 additions & 0 deletions ray4/craig/convert
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
files=`ls slice_*`
for i in $files
do
echo
echo $i:
mtvtorast $i
done
echo "Delete data files: (y/n): "
read del
if test "$del" = y
then
for i in $files
do
rm -i $i
done
fi
Loading

0 comments on commit 75511f3

Please sign in to comment.