Commit a429d990 authored by Karol Actun's avatar Karol Actun
Browse files

changes for macOS

parent 6324a170
......@@ -4,7 +4,7 @@
seedvalue = 12
## Maximum round number in swarm-world, 0 = infinite
max_round = 100
max_round = 1000
## 1/True = Call of particles in randmom order
## 0/False = Call of particles in added order in scenario
......@@ -36,18 +36,18 @@ gui = default_gui
;# end of Quadratic grid configs
# Triangular grid default configs:
;# Triangular grid default configs:
;grid_class = TriangularGrid
;particle_model_file = 2d_particle.obj
;tile_model_file = 2d_hex_tile.obj
;location_model_file = 2d_location.obj
;grid_size = 100
# end of Triangular grid configs
;# end of Triangular grid configs
;
;# cubic grid default configs:
;grid_class = CubicGrid
;particle_model_file = 3d_particle_low_poly.obj
;particle_model_file = 3d_particle.obj
;tile_model_file = 3d_cube_tile.obj
;location_model_file = 3d_location.obj
;grid_size = 10
......@@ -58,7 +58,7 @@ gui = default_gui
grid_class = CCPGrid
particle_model_file = 3d_particle.obj
tile_model_file = 3d_ccp_tile.obj
location_model_file = 3d_location_2.obj
location_model_file = 3d_location.obj
grid_size = 10
# end of ccp grid configs
......@@ -67,8 +67,8 @@ grid_size = 10
particle_color = (0.8, 0.3, 0.3, 1.0)
particle_scaling = (1.0, 1.0, 1.0)
tile_color = (0.0, 0.0, 0.0, 0.5)
tile_scaling = (0.1, 0.1, 0.1)
tile_color = (0.3, 0.3, 0.8, 1.0)
tile_scaling = (1.0, 1.0, 1.0)
location_color = (0.3, 0.8, 0.3, 1.0)
location_scaling = (1.2, 1.2, 1.2)
......@@ -80,11 +80,11 @@ center_color = (1.0, 0.0, 0.0, 0.5)
# background (rgb)
background_color = (1.0, 1.0, 1.0)
# color of grid lines (rgba)
line_color = (0.0, 0.0, 0.0, 1.0)
line_color = (0.0, 0.0, 0.0, 0.5)
# length/scaling of the grid lines (max should be 1,1,1)
line_scaling = (1.0, 1.0, 1.0)
# flag for showing the lines
show_lines = False
show_lines = True
# color of grid coordinates (rgba)
coordinates_color = (0.0, 0.0, 0.0, 1.0)
# size/scaling of the coordinate model. wouldn't make it bigger than 0.2, 0.2, 0.2
......@@ -92,7 +92,7 @@ coordinates_scaling = (0.05, 0.05, 0.05)
# flag for showing the coordinate models
show_coordinates = False
# flag for showing the center of the grid
show_center = False
show_center = True
# camera focus color
focus_color = (1.0, 1.0, 1.0, 0.5)
# show camera focus
......@@ -135,14 +135,14 @@ tile_mm_size = 2
##Examples##
#marking (rasenmäher) in 3D
scenario = marking_3d_scenario
solution = marking_3d_local
#marking (rasenmäher) algorithm in 3D
;scenario = marking_3d_scenario
;solution = marking_3d_local
##Moving
#scenario = lonely_particle
#scenario = n_particle_in_line
#solution = random_walk
scenario = n_particle_in_line
solution = random_walk
#solution = triangular_round_walk
#solution = random_walk_with_take_and_drop
......@@ -158,7 +158,7 @@ solution = marking_3d_local
#scenario = two_particles_tiles_markers
#solution = read_write
#scenario = test_interfaces
#solution = test_all_the_interfaces
>>>>>>> origin
;scenario = test_interfaces
;solution = test_all_the_interfaces
......@@ -147,7 +147,6 @@ def vis_tab(vis: Visualization):
def grid_tab(vis: Visualization):
tab = QTabBar()
layout = QVBoxLayout()
layout.addLayout(get_grid_width_slider(vis))
layout.addLayout(get_grid_lines_scale_slider(vis))
layout.addLayout(get_grid_coordinates_scale_slider(vis))
layout.addLayout(get_show_checkboxes(vis))
......@@ -458,20 +457,6 @@ def get_color_picker(vis):
return vbox
def get_grid_width_slider(vis):
hbox = QVBoxLayout()
desc = QLabel("grid width (%d):" % vis.get_grid_line_width())
hbox.addWidget(desc, alignment=Qt.AlignBaseline)
def set_gw(value):
vis.set_grid_line_width(value)
desc.setText("grid width (%d):" % value)
hbox.addWidget(create_slider(1, 2, glGetFloatv(GL_LINE_WIDTH_RANGE)[1], 1, vis.get_grid_line_width(), set_gw),
alignment=Qt.AlignBaseline)
return hbox
def get_render_distance_slider(vis):
vbox = QVBoxLayout()
desc = QLabel("render distance (%d):" % vis.get_render_distance())
......
......@@ -20,7 +20,11 @@ class OGLWidget(QtOpenGL.QGLWidget):
:param world: the world class
:param camera: a camera for the visualization
"""
super(OGLWidget, self).__init__()
fmt = QtOpenGL.QGLFormat()
fmt.setVersion(3, 3)
fmt.setProfile(QtOpenGL.QGLFormat.CoreProfile)
fmt.setSampleBuffers(True)
super(OGLWidget, self).__init__(fmt)
self.debug = False
self.world = world
......@@ -118,6 +122,7 @@ class OGLWidget(QtOpenGL.QGLWidget):
# set global openGL settings
GL.glEnable(GL.GL_DEPTH_TEST)
GL.glEnable(GL.GL_BLEND)
GL.glEnable(GL.GL_CULL_FACE)
GL.glEnable(GL.GL_LINE_SMOOTH)
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)
GL.glClearColor(*self.background, 1.0)
......
#version 110
#version 330
varying vec4 v_color;
in vec4 v_color;
out vec4 FragColor;
void main() {
gl_FragColor = v_color;
FragColor = v_color;
}
// vertex shader for the GridProgram
#version 110
#version 330
// position vector of location model or direction line VBO 0
attribute vec3 position;
in vec3 position;
// normal vector of location model face VBO 0
attribute vec3 normal;
in vec3 normal;
// offsets of the model (location & lines) VBO 1
attribute vec3 offset;
in vec3 offset;
//projection matrix
uniform mat4 projection;
......@@ -35,7 +33,7 @@ uniform bool drawing_lines;
// varying color for fragment shader
varying vec4 v_color;
out vec4 v_color;
void main(void)
{
if(drawing_lines){
......
// vertex shader for the OffsetColorCarryProgram
#version 110
#version 330
// VBO 0 - per vertex
// vector of a face
attribute vec3 position;
in vec3 position;
// normal vector of the vector/face
attribute vec3 normal;
in vec3 normal;
// VBO 1 - per instance - position offset of the model
attribute vec3 offset;
in vec3 offset;
// VBO 2 - per instance - color of the model
attribute vec4 color;
in vec4 color;
// VBO 3 - per instance - is carried
attribute float carried;
in float carried;
// uniforms
......@@ -35,7 +33,7 @@ uniform vec3 light_direction;
uniform vec4 light_color;
// varying color for fragment shader
varying vec4 v_color;
out vec4 v_color;
void main(void)
......
// vertex shader for the OffsetColorProgram
#version 110
#version 330
// VBO 0 - per vertex
// vector of a face
attribute vec3 position;
in vec3 position;
// normal vector of the vector/face
attribute vec3 normal;
in vec3 normal;
// VBO 1 - per instance
// position offset of the model
attribute vec3 offset;
in vec3 offset;
// color of the model
attribute vec4 color;
in vec4 color;
// uniforms
// projection matrix
......@@ -33,7 +31,7 @@ uniform vec3 light_direction;
uniform vec4 light_color;
// varying color for fragment shader
varying vec4 v_color;
out vec4 v_color;
void main(void)
......
Markdown is supported
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