Skip to content

Commit

Permalink
Modded parameter generater
Browse files Browse the repository at this point in the history
  • Loading branch information
GangGreenery committed Apr 6, 2015
1 parent 5c8d2d6 commit 2bb17a6
Show file tree
Hide file tree
Showing 22 changed files with 69 additions and 23 deletions.
Binary file added MandelBox(GreenBlackRed)/3d.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/distance_est.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/getcolor.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/getparams.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/init3D.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/main.o
Binary file not shown.
3 changes: 2 additions & 1 deletion MandelBox(GreenBlackRed)/makeVideo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

echo "Creating new frame"
echo "Creating new frame" #avconv -framerate 30 -i image%d.bmp output.avi
avconv -framerate 30 -i image%d.bmp output.avi

4 changes: 2 additions & 2 deletions MandelBox(GreenBlackRed)/makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
LDFLAGS = -lm -fopenmp
CFLAGS= -O3 -Wall -fopenmp
CXXFLAGS= -O3 -Wall -fopenmp
CXX=g++-4.9
CC=g++-4.9
CXX=g++
CC=g++
RM=rm

PROGRAM_NAME= mandelbox
Expand Down
Binary file added MandelBox(GreenBlackRed)/mandelbox
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/mandelboxde.o
Binary file not shown.
Binary file modified MandelBox(GreenBlackRed)/mpirunner
Binary file not shown.
12 changes: 7 additions & 5 deletions MandelBox(GreenBlackRed)/mpiwrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,24 @@ int main(int argc, char* argv[]) {
start = atoi(argv[1]);
end = atoi(argv[2]);
int block = (end - start)/ p;
remainder = (end - start) % p;
int remainder = (end - start) % p;




for (int i = start + (block*my_rank); i < (my_rank+1)*block; i++)
for (int i = start + (block*my_rank); i < ((my_rank+1)*block +start); i++)
{

sprintf(newparams,"params/params%d.dat",i);
sprintf(command, "./mandelbox %s", newparams);
//printf("%s\n", command);
//call the command to make the mandelbrot image
system(command);
}

if (my_rank == 1) {
if (my_rank == 0) {

for (int i = block * p; i < remainder; i++)
for (int i = block * p; i < end; i++)
{
sprintf(newparams,"params/params%d.dat",i);
sprintf(command, "./mandelbox %s", newparams);
Expand Down
Binary file removed MandelBox(GreenBlackRed)/output.avi
Binary file not shown.
2 changes: 1 addition & 1 deletion MandelBox(GreenBlackRed)/params/baseParams.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CAMERA
# location x,y,z (7,7,7)
# location x,y,z (7,7,7) 6 6 12
6 6 12
# look_at (target) x,y,z
0 0 0
Expand Down
2 changes: 1 addition & 1 deletion MandelBox(GreenBlackRed)/params/baseparams.dat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
1.5
# IMAGE
# width height
800 600
400 300
# detail level, the smaller the more detailed (-3)
-3.3
# MANDELBOX
Expand Down
69 changes: 56 additions & 13 deletions MandelBox(GreenBlackRed)/params/generateParams.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,60 @@ do
echo "Generating file $i"
paramFile=params$i.dat
sed 's/imageX/image'$i'/' baseParams.dat >$paramFile
j=$(($i - 615))
if [ $i -le 614 ] ;
then
awk -v i="$i" '{ gsub(/2.4 3.58 1.3/, "2.4 " 3.58 - i * 0.005813008 " 1.3")};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile
awk -v i="$i" '{ gsub(/6 6 12/, "6 6 " 12 - i * 0.009756097)};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile
else
awk -v i="$j" '{ gsub(/6 6 12/, 6*0.998^i" " 6*0.998^i" "6*0.998^i)};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile
awk '{ gsub(/2.4 3.58 1.3/, "2.4 " 0.0005 " 1.3")};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile
fi
#j=$(($i - 615))

#Initial rendering of the orb into a cube while moving towards zoom-in point
#if [ $i -le 614 ] ;
#then
# awk -v i="$i" '{ gsub(/2.4 3.58 1.3/, "2.4 " 3.58 - i * 0.005813008 " 1.3")};{print}' $paramFile > $paramFile.new
# mv $paramFile.new $paramFile
# awk -v i="$i" '{ gsub(/6 6 12/, "6 6 " 12 - i * 0.009756097)};{print}' $paramFile > $paramFile.new
# mv $paramFile.new $paramFile

#Moves the camera
#else
# awk -v i="$i" '{ gsub(/6 6 12/, 2.295149969*0.9998^i" " 2.295149969*0.9998^i" "2.295149969*0.9998^i)};{print}' $paramFile > $paramFile.new
# mv $paramFile.new $paramFile
# awk '{ gsub(/2.4 3.58 1.3/, "2.4 " 0.0005 " 1.3")};{print}' $paramFile > $paramFile.new
# mv $paramFile.new $paramFile

##On second 36.5, moves camera view down for 6 seconds while moving towards the center at 0.9998% per frame
##if [ $i -gt 1094 ] ;
## then
## awk -v i="$i" '{ gsub(/0 0 0/, "0 " 0-0.025*i " 0")};{print}' $paramFile > $paramFile.new
## mv $paramFile.new $paramFile
## awk -v i="$i" '{ gsub(/6 6 12/, 2.295149969*0.9998^i" " 2.295149969*0.9998^i" "2.295149969*0.9998^i)};{print}' $paramFile > $paramFile.new
## mv $paramFile.new $paramFile
## awk '{ gsub(/2.4 3.58 1.3/, "2.4 " 0.0005 " 1.3")};{print}' $paramFile > $paramFile.new
## mv $paramFile.new $paramFile
##fi

##On second 32.5, moves camera in -y direction for 6 seconds
##awk -v i="$i" '{ gsub(/0 0 0/, "0 -5.25 0")};{print}' $paramFile > $paramFile.new
##mv $paramFile.new $paramFile
##awk -v i="$i" '{ gsub(/6 6 12/, "2.200740703 " 2.200740703*0.992^i " 2.200740703")};{print}' $paramFile > $paramFile.new
##mv $paramFile.new $paramFile
##awk '{ gsub(/2.4 3.58 1.3/, "2.4 " 0.0005 " 1.3")};{print}' $paramFile > $paramFile.new
##mv $paramFile.new $paramFile


awk -v i="$i" '{ gsub(/0 0 0/, "0 -5.25 " 0-0.025*i)};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile
awk -v i="$i" '{ gsub(/6 6 12/, "2.200740703 0.407399065 2.200740703")};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile
awk '{ gsub(/2.4 3.58 1.3/, "2.4 " 0.0005 " 1.3")};{print}' $paramFile > $paramFile.new
mv $paramFile.new $paramFile







#fi
done

#awk -v i="$j" '{ gsub(/6 6 12/, 6*0.998^i" " 6*0.998^i" "6*0.998^i)};{print}' $paramFile > $paramFile.new

#41s mark
#awk -v i="$i" '{ gsub(/6 6 12/, 1.751596796*0.9998^i" " 1.751596796*0.9998^i" "1.751596796*0.9998^i)};{print}' $paramFile > $paramFile.new
Binary file added MandelBox(GreenBlackRed)/print.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/raymarching.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/renderer.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/savebmp.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/timing.o
Binary file not shown.
Binary file added MandelBox(GreenBlackRed)/�~
Binary file not shown.

0 comments on commit 2bb17a6

Please sign in to comment.