Commit d832ab37 authored by Luiz Velho's avatar Luiz Velho
Browse files

first commit

parents
- Notes for Linux
------------------
- Para o cmake reconhecer o Qt5 que não esteja instalado no sistema
e sim em um diretório do usuário, é necessário rodar o cmake desta maneira:
$ CMAKE_PREFIX_PATH=~/Applications/Qt5/5.5/gcc_64/lib/cmake/ cmake ../core
- Para executar os testes as libs do Qt5 devem estar visíveis para o sistema.
Então, basta executar o seguinte comando:
$ export LD_LIBRARY_PATH=~/Applications/Qt5/5.5/gcc_64/lib
- Notes for Mac OS
-------------------
- Have HomeBrew and Qt installed
- Add to your .profile:
export PATH=$PATH:/Programs/Devel/Qt/5.5/clang_64/bin/
- Install GLEW with HomeBrew:
$ brew install glew
S3D/Core Software
=================
This is the companion software package of the book
"Design and Implementation of 3D Graphics Systems"
by Luiz Velho and Jonas Gomes and Mario Sousa.
The software contains an implementation of all the
algorithms described in the book.
CONTENTS
--------
The directory hierarchy structure is as follows:
./s3d
/core - Linux relatead source code
/data - Data files
/test - Test scripts
/platforms - Deployment
/build - CMake build directory
./s3d/core
/base - Source of the Base library
/proj - Source of the Applications
./s3d/data
/model - Geometric Model
/scn - 3D Scene Files
/pic - Images
./s3d/tst
/demo - Scripts to Run the CPU demos
/gldemo - Scripts to Run the GPU demos
./s3d/platforms
/qt - QT Creator projects
/linux/bin - Executables
/linux/lib - Libraries
/linux/include - Header files
INSTALLATION
------------
To install the Linux software run these commands in the "build" directory
cmake ../core
make
make install
This should generate, compile and install the libraries and applications.
TESTING
-------
To play the CPU demos run the main shell in the demo directory
cd test/demo
sh run-all
This will execute all applications with test data.
To play the GPU demos run the main shell in the gldemo directory
cd tst/gldemo
sh run-new
To complie and run the QT demo
cd platforms/qt/s3dgl
Open the project s3dgl.pro with QtCreator
run s3dgl
drag and drop the files in platforms/qt/scenes
COMPATIBILITY
-------------
This software was developed using GNU tools under the
Linux operating system. It has also been ported to MacOS X
and it may compile in Windows using the Cygwin/MinGW environment.
REQUIREMENTS
------------
The software needs the following development tools
cmake, sh, make, gcc, bison, flex.
It uses the imaging library libpng.
The OpenGL implementation requires GLEW, GLUT and GLSL 2.1,
The QT Applications require Qt 5.4 or higher.
REMARKS
-------
Please note that for QT Applications work properly under Linux
the following environment variables have to be set as indicated below.
LANG=C
LC_NUMERIC=C
In QtCreator, this can be set up using the selection:
Project -> Run Settings -> Build Environments
UPDATES
-------
For updates and more information go to the book website:
http://www.visgraf.impa.br/sg3d/
VERSION
-------
6.3
Copyright 1999 - 2016 - Luiz Velho
core @ 2db32481
Subproject commit 2db32481826c5fdf593d2b0ada9798a9a707b1b8
.2 1 0
1 1 0
1 -1 0
.2 -1 0
(s{1.1 -.3 .5 0} & (s{.1 -3.01 0 5} | s{1 0 0 5}))
\ No newline at end of file
scene{
camera = view{ from = {0, 0.2, -1.2},
at = {0, 0, 0},
up = {0,1,0},
fov = 60,
imgw=512, imgh=512 },
light = dist_light{ direction = {0, 1, 1} },
object = group{
transform = affine { translation = {0, 0, 0},
rotation = {0, 0, motor{ arg{ v1 = .2 }}}},
child = group {
transform = affine { translation = {.1, 0, 0},
scaling = {1, .4, .4}},
child = primobj{ shape = sphere{radius = .1 }}
},
child = group {
transform = affine { translation = {.2, 0, 0},
rotation = {0, 0, motor{ arg{ v2 = .1 }}}},
child = group {
transform = affine { translation = {.2, 0, 0},
scaling = {2, .4, .4}},
child = primobj{ shape = sphere{radius = .1}}
}
},
}
};
scene{
camera = view{ from = {0, 0.2, -1.2},
at = {0, 0, 0},
up = {0,1,0},
fov = 60,
imgw=512, imgh=512 },
light = dist_light{ direction = {0, 0, -1} },
object = group {
transform = param { rts = {0, 0, 0, 0, 0, 0, 1, 1, 1}},
child = group {
transform = mouse { assign = {-1, -1, 0, -1, -1, -1, -1, -1, -1}},
child = group {
transform = affine { translation = {.1, 0, 0},
scaling = {1, .4, .4}},
child = primobj{ shape = sphere{radius = .1 }}
},
child = group {
transform = affine { translation = {.2, 0, 0},},
child = group {
transform = mouse { assign = {-1, -1, 1, -1, -1, -1, -1, -1, -1}},
child = group {
transform = affine { translation = {.2, 0, 0},
scaling = {2, .4, .4}},
child = primobj{ shape = sphere{radius = .1}}
},
},
},
},
},
};
scene{
camera = view {
from = {0, 0.5, -1.5}, at = {0, 0, 0}, up = {0,1,0}, fov = 60
},
light = dist_light { direction = {0, 1, -1} },
object = primobj { shape = sphere{ radius = .5, center = {0.2, 0, 0} }},
};
scene{
camera = view {
from = {0, -1, 2}, at = {0, 0, 0}, roll = 0, fov = 60
},
light = dist_light {direction = {1, 1, -1} },
light = dist_light {direction = {0, 1, 2} },
object = primobj{
material = rough { ka = .2, kd = 0.8,
tex_src = imagemap { fname = "pits.png"} },
shape = sphere { center = {0, 0, 0}}},
};
scene{
camera = view {
from = {0, 0, -4}, at = {0, 0, 0}, up = {0,1,0}, fov = 60
},
light = dist_light {direction = {0, 1, -1} },
object = csgobj{
material = plastic { ka = .2, kd = 0.8, ks = 0.0 },
shape = csg_diff {
csg_prim{ sphere { center = {0, 0, 0}}},
csg_prim{ sphere { center = {1, 1, -1}}}
}
}
};
scene {
camera = view {
from = {0, 0, -4}, at = {0, 0, 0}, up = {0,1,0}, fov = 60,
imgw = 320, imgh = 240
},
light = dist_light {direction = {0, 0, -1} },
object = polyobj {
material = plastic { se = 2 },
shape = trilist {
{{0.962917, -1, 0.269797}, {1, -1, 3.0718e-07}, {1, 1, 3.0718e-07}}
,
{{0.962917, 1, 0.269797}, {0.962917, -1, 0.269797}, {1, 1, 3.0718e-07}}
,
{{0.854419, -1, 0.519584}, {0.962917, -1, 0.269797}, {0.962917, 1, 0.269797}}
,
{{0.854419, 1, 0.519584}, {0.854419, -1, 0.519584}, {0.962917, 1, 0.269797}}
,
{{0.682553, -1, 0.730836}, {0.854419, -1, 0.519584}, {0.854419, 1, 0.519584}}
,
{{0.682553, 1, 0.730836}, {0.682553, -1, 0.730836}, {0.854419, 1, 0.519584}}
,
{{0.460065, -1, 0.887885}, {0.682553, -1, 0.730836}, {0.682553, 1, 0.730836}}
,
{{0.460065, 1, 0.887885}, {0.460065, -1, 0.887885}, {0.682553, 1, 0.730836}}
,
{{0.203456, -1, 0.979084}, {0.460065, -1, 0.887885}, {0.460065, 1, 0.887885}}
,
{{0.203456, 1, 0.979084}, {0.203456, -1, 0.979084}, {0.460065, 1, 0.887885}}
,
{{-0.0682426, -1, 0.997669}, {0.203456, -1, 0.979084}, {0.203456, 1, 0.979084}}
,
{{-0.0682426, 1, 0.997669}, {-0.0682426, -1, 0.997669}, {0.203456, 1, 0.979084}}
,
{{-0.33488, -1, 0.942261}, {-0.0682426, -1, 0.997669}, {-0.0682426, 1, 0.997669}}
,
{{-0.33488, 1, 0.942261}, {-0.33488, -1, 0.942261}, {-0.0682426, 1, 0.997669}}
,
{{-0.57668, -1, 0.81697}, {-0.33488, -1, 0.942261}, {-0.33488, 1, 0.942261}}
,
{{-0.57668, 1, 0.81697}, {-0.57668, -1, 0.81697}, {-0.33488, 1, 0.942261}}
,
{{-0.775711, -1, 0.631088}, {-0.57668, -1, 0.81697}, {-0.57668, 1, 0.81697}}
,
{{-0.775711, 1, 0.631088}, {-0.775711, -1, 0.631088}, {-0.57668, 1, 0.81697}}
,
{{-0.917211, -1, 0.398401}, {-0.775711, -1, 0.631088}, {-0.775711, 1, 0.631088}}
,
{{-0.917211, 1, 0.398401}, {-0.917211, -1, 0.398401}, {-0.775711, 1, 0.631088}}
,
{{-0.990686, -1, 0.136166}, {-0.917211, -1, 0.398401}, {-0.917211, 1, 0.398401}}
,
{{-0.990686, 1, 0.136166}, {-0.990686, -1, 0.136166}, {-0.917211, 1, 0.398401}}
,
{{-0.990686, -1, -0.136167}, {-0.990686, -1, 0.136166}, {-0.990686, 1, 0.136166}}
,
{{-0.990686, 1, -0.136167}, {-0.990686, -1, -0.136167}, {-0.990686, 1, 0.136166}}
,
{{-0.917211, -1, -0.398401}, {-0.990686, -1, -0.136167}, {-0.990686, 1, -0.136167}}
,
{{-0.917211, 1, -0.398401}, {-0.917211, -1, -0.398401}, {-0.990686, 1, -0.136167}}
,
{{-0.775711, -1, -0.631088}, {-0.917211, -1, -0.398401}, {-0.917211, 1, -0.398401}}
,
{{-0.775711, 1, -0.631088}, {-0.775711, -1, -0.631088}, {-0.917211, 1, -0.398401}}
,
{{-0.57668, -1, -0.81697}, {-0.775711, -1, -0.631088}, {-0.775711, 1, -0.631088}}
,
{{-0.57668, 1, -0.81697}, {-0.57668, -1, -0.81697}, {-0.775711, 1, -0.631088}}
,
{{-0.33488, -1, -0.942261}, {-0.57668, -1, -0.81697}, {-0.57668, 1, -0.81697}}
,
{{-0.33488, 1, -0.942261}, {-0.33488, -1, -0.942261}, {-0.57668, 1, -0.81697}}
,
{{-0.0682423, -1, -0.997669}, {-0.33488, -1, -0.942261}, {-0.33488, 1, -0.942261}}
,
{{-0.0682423, 1, -0.997669}, {-0.0682423, -1, -0.997669}, {-0.33488, 1, -0.942261}}
,
{{0.203456, -1, -0.979084}, {-0.0682423, -1, -0.997669}, {-0.0682423, 1, -0.997669}}
,
{{0.203456, 1, -0.979084}, {0.203456, -1, -0.979084}, {-0.0682423, 1, -0.997669}}
,
{{0.460065, -1, -0.887885}, {0.203456, -1, -0.979084}, {0.203456, 1, -0.979084}}
,
{{0.460065, 1, -0.887885}, {0.460065, -1, -0.887885}, {0.203456, 1, -0.979084}}
,
{{0.682553, -1, -0.730836}, {0.460065, -1, -0.887885}, {0.460065, 1, -0.887885}}
,
{{0.682553, 1, -0.730836}, {0.682553, -1, -0.730836}, {0.460065, 1, -0.887885}}
,
{{0.854419, -1, -0.519584}, {0.682553, -1, -0.730836}, {0.682553, 1, -0.730836}}
,
{{0.854419, 1, -0.519584}, {0.854419, -1, -0.519584}, {0.682553, 1, -0.730836}}
,
{{0.962917, -1, -0.269797}, {0.854419, -1, -0.519584}, {0.854419, 1, -0.519584}}
,
{{0.962917, 1, -0.269797}, {0.962917, -1, -0.269797}, {0.854419, 1, -0.519584}}
,
{{1, -1, 0}, {0.962917, -1, -0.269797}, {0.962917, 1, -0.269797}}
,
{{1, 1, 0}, {1, -1, 0}, {0.962917, 1, -0.269797}}
}}};
scene{
camera = view {
from = {-2.0, .1, 0}, at = {0, 0, 0}, roll = 3.1415, fov = 90
},
light = dist_light {direction = {0, 1, -1} },
light = dist_light {direction = {0, 1, 2} },
object = primobj{
material = shiny { ka = .2, ks = 0.8,
tex_src = imagemap { fname = "envmap.png"} },
shape = sphere { center = {0, 0, 0}}},
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment