now using the Koch Snowflake (from fractals.dat) instead of Cantor dust
for fractals and fractals_random demo (changed built-in data). Looks better Also removed copying of fractals.dat to build dir from CMake file git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1272 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
c04a82ac47
commit
45b71f41a9
@ -381,25 +381,6 @@ ADD_DEMO(spaceball progs/demos/spaceball/spaceball.c
|
||||
ADD_DEMO(subwin progs/demos/subwin/subwin.c)
|
||||
ADD_DEMO(timer progs/demos/timer/timer.c)
|
||||
|
||||
# finally, if any demos are built, copy needed files to output directory
|
||||
# (currently, thats just the input file for the Fractals demo)
|
||||
IF(FREEGLUT_BUILD_DEMOS)
|
||||
# 1) copy fractals.dat from freeglut/progs/demos/Fractals
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET(Frac_target Fractals)
|
||||
ELSE()
|
||||
SET(Frac_target Fractals_static)
|
||||
ENDIF()
|
||||
GET_TARGET_PROPERTY(DEMO_OUTPUT_DIRECTORY ${Frac_target} RUNTIME_OUTPUT_DIRECTORY)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${Frac_target}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${PROJECT_SOURCE_DIR}/progs/demos/Fractals/fractals.dat
|
||||
${DEMO_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
# pkg-config support, to install at $(libdir)/pkgconfig
|
||||
# Define static build dependencies
|
||||
IF(WIN32)
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#define FGH_PI 3.14159265358979323846
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -267,13 +268,20 @@ void readConfigFile ( char *fnme )
|
||||
else /* No data file, set a default */
|
||||
{
|
||||
printf ( "ERROR opening file <%s>\n", fnme ) ;
|
||||
strcpy ( window_title, "Cantor Dust" ) ;
|
||||
num_trans = 2 ;
|
||||
strcpy ( window_title, "Koch Snowflake" ) ;
|
||||
num_trans = 4 ;
|
||||
affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
|
||||
affine[0].a00 = 0.25 ; affine[0].a01 = 0.00 ; affine[0].a10 = 0.00 ; affine[0].a11 = 0.25 ;
|
||||
affine[0].a00 = 1/3. ; affine[0].a01 = 0.00 ; affine[0].a10 = 0.00 ; affine[0].a11 = 1/3. ;
|
||||
affine[0].b0 = 0.0 ; affine[0].b1 = 0.0 ;
|
||||
affine[1].a00 = 0.25 ; affine[1].a01 = 0.00 ; affine[1].a10 = 0.00 ; affine[1].a11 = 0.25 ;
|
||||
affine[1].b0 = 0.5 ; affine[1].b1 = 0.0 ;
|
||||
|
||||
affine[1].a00 = 1/6. ; affine[1].a01 = -1/3.*sin(FGH_PI/3.) ; affine[1].a10 = 1/3.*sin(FGH_PI/3.) ; affine[1].a11 = 1/6. ;
|
||||
affine[1].b0 = 1/3. ; affine[1].b1 = 0.0 ;
|
||||
|
||||
affine[2].a00 = 1/6. ; affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ; affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ; affine[2].a11 = 1/6. ;
|
||||
affine[2].b0 = 0.5 ; affine[2].b1 = sqrt(3)/6. ;
|
||||
|
||||
affine[3].a00 = 1/3. ; affine[3].a01 = 0.00 ; affine[3].a10 = 0.00 ; affine[3].a11 = 1/3. ;
|
||||
affine[3].b0 = 2/3. ; affine[3].b1 = 0.0 ;
|
||||
}
|
||||
|
||||
for ( i = 0; i < num_trans; i++ )
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#define FGH_PI 3.14159265358979323846
|
||||
#ifdef _MSC_VER
|
||||
/* DUMP MEMORY LEAKS */
|
||||
#include <crtdbg.h>
|
||||
@ -311,13 +312,20 @@ void readConfigFile ( char *fnme )
|
||||
else /* No data file, set a default */
|
||||
{
|
||||
printf ( "ERROR opening file <%s>\n", fnme ) ;
|
||||
strcpy ( window_title, "Cantor Dust" ) ;
|
||||
num_trans = 2 ;
|
||||
strcpy ( window_title, "Koch Snowflake" ) ;
|
||||
num_trans = 4 ;
|
||||
affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
|
||||
affine[0].a00 = 0.25 ; affine[0].a01 = 0.00 ; affine[0].a10 = 0.00 ; affine[0].a11 = 0.25 ;
|
||||
affine[0].a00 = 1/3. ; affine[0].a01 = 0.00 ; affine[0].a10 = 0.00 ; affine[0].a11 = 1/3. ;
|
||||
affine[0].b0 = 0.0 ; affine[0].b1 = 0.0 ;
|
||||
affine[1].a00 = 0.25 ; affine[1].a01 = 0.00 ; affine[1].a10 = 0.00 ; affine[1].a11 = 0.25 ;
|
||||
affine[1].b0 = 0.5 ; affine[1].b1 = 0.0 ;
|
||||
|
||||
affine[1].a00 = 1/6. ; affine[1].a01 = -1/3.*sin(FGH_PI/3.) ; affine[1].a10 = 1/3.*sin(FGH_PI/3.) ; affine[1].a11 = 1/6. ;
|
||||
affine[1].b0 = 1/3. ; affine[1].b1 = 0.0 ;
|
||||
|
||||
affine[2].a00 = 1/6. ; affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ; affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ; affine[2].a11 = 1/6. ;
|
||||
affine[2].b0 = 0.5 ; affine[2].b1 = sqrt(3)/6. ;
|
||||
|
||||
affine[3].a00 = 1/3. ; affine[3].a01 = 0.00 ; affine[3].a10 = 0.00 ; affine[3].a11 = 1/3. ;
|
||||
affine[3].b0 = 2/3. ; affine[3].b1 = 0.0 ;
|
||||
}
|
||||
|
||||
for ( i = 0; i < num_trans; i++ )
|
||||
|
Reference in New Issue
Block a user