JuliaGL / GLVisualize.jl

Visualization library written in Julia and OpenGL
Other
247 stars 34 forks source link

cubecamera error #246

Closed pbouffard closed 6 years ago

pbouffard commented 6 years ago

Possibly just a beginner's mistake?

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin14.5.0

julia> using GLVisualize

julia> window = glscreen()
name: GLVisualize
children: 0
Inputs:
  mouse_button_released => Reactive.Signal{Int64}
  mouse_buttons_pressed => Reactive.Signal{Set{Int64}}
  scroll => Reactive.Signal{GeometryTypes.Vec{2,Float64}}
  buttons_pressed => Reactive.Signal{Set{Int64}}
  window_size => Reactive.Signal{GeometryTypes.Vec{2,Int64}}
  window_area => Reactive.Signal{GeometryTypes.SimpleRectangle{Int64}}
  cursor_position => Reactive.Signal{GeometryTypes.Vec{2,Float64}}
  mouseinside => Reactive.Signal{Bool}
  mouse_button_down => Reactive.Signal{Int64}
  mouseposition => Reactive.Signal{GeometryTypes.Vec{2,Float64}}
  arrow_navigation => Reactive.Signal{Symbol}
  key_pressed => Reactive.Signal{Bool}
  mouse2id => Reactive.Signal{GLWindow.SelectionID{Int64}}
  framebuffer_size => Reactive.Signal{GeometryTypes.Vec{2,Int64}}
  button_down => Reactive.Signal{Int64}
  unicode_input => Reactive.Signal{Array{Char,1}}
  window_position => Reactive.Signal{GeometryTypes.Vec{2,Int64}}
  mouse_buttons => Reactive.Signal{Tuple{Int64,Int64,Int64}}
  entered_window => Reactive.Signal{Bool}
  button_released => Reactive.Signal{Int64}
  window_open => Reactive.Signal{Bool}
  dropped_files => Reactive.Signal{Array{String,1}}
  hasfocus => Reactive.Signal{Bool}
  keyboard_buttons => Reactive.Signal{NTuple{4,Int64}}

julia> cubecamera(window)
ERROR: MethodError: no method matching filter(::GLVisualize.##297#303{Reactive.Signal{GLWindow.SelectionID{Int64}},Reactive.Signal{Int64}}, ::Bool, ::Reactive.Signal{Bool})
You may have intended to import Base.filter
Closest candidates are:
  filter(::Any, ::Any) at iterators.jl:271
Stacktrace:
 [1] #cubecamera#296(::Reactive.Signal{GeometryTypes.SimpleRectangle{Int64}}, ::GeometryTypes.Vec{3,Float32}, ::GeometryTypes.Vec{3,Float32}, ::Reactive.Signal{GeometryTypes.Vec{3,Float32}}, ::Reactive.Signal{GeometryTypes.Vec{3,Float32}}, ::Function, ::GLWindow.Screen, ::Reactive.Signal{GLAbstraction.Projection}) at /Users/pat/.julia/v0.6/GLVisualize/src/camera.jl:74
 [2] cubecamera(::GLWindow.Screen, ::Reactive.Signal{GLAbstraction.Projection}) at /Users/pat/.julia/v0.6/GLVisualize/src/camera.jl:69 (repeats 2 times)
edljk commented 6 years ago

Same kind of issue with Makie

julia> Makie.Scene()
ERROR (unhandled task failure): MethodError: no method matching (::GLWindow.##23#24{Reactive.Signal{Tuple{Int64,Int64,Int64}}})(::GLFW.Window, ::Int32, ::GLFW.Action, ::Int32)
Closest candidates are:
  #23(::Any, ::Int32, ::Int32, ::Int32)
...
SimonDanisch commented 6 years ago

Oh, that happens because I import Base.Iterators: filter which was recommend in some deprecation warning... Jeez, so Base has actually now 2 filter functions, depending on the types?

edljk commented 6 years ago

After upgrade I still have a related (?) issue

julia> using GLVisualize, GeometryTypes
julia> window = GLVisualize.glscreen();
julia> mm = GLNormalMesh(Sphere{Float32}(Point3f0(0), Float32(1.)), 50);
julia> GLVisualize._view(GLVisualize.visualize(mm), window);
julia> GLVisualize.renderloop(window)

The sphere is displayed correctly but when I try to rotate it, the following error comes up

ERROR: MethodError: no method matching (::GLWindow.##23#24{Reactive.Signal{Tuple{Int64,Int64,Int64}}})(::GLFW.Window, ::Int32, ::GLFW.Action, ::Int32)
Closest candidates are:
  #23(::Any, ::Int32, ::Int32, ::Int32) at $HOME/.julia/v0.6/GLWindow/src/callbacks.jl:65
Stacktrace:
 [1] _MouseButtonCallbackWrapper(::Ptr{Void}, ::Int32, ::GLFW.Action, ::Int32) at $HOME/.julia/v0.6/GLFW/src/callback.jl:53
 [2] #renderloop#39(::Float64, ::GLWindow.##40#42, ::Function, ::GLWindow.Screen) at $HOME/.julia/v0.6/GLWindow/src/render.jl:45
 [3] renderloop(::GLWindow.Screen) at $HOME/.julia/v0.6/GLWindow/src/render.jl:40
SimonDanisch commented 6 years ago

I can't reproduce this (as well as the Makie error). Can you give your Julia version + Pkg.status?

edljk commented 6 years ago

julia Version 0.6.2-pre.0, linux ubuntu,

julia> Pkg.status()
...
 - GLAbstraction                 0.6.1              master
 - GLFW                          1.5.0+             master
 - GLVisualize                   0.6.1+             master
 - GLWindow                      0.7.1              master
 - Makie                         0.0.0-             master (unregistered)
...
SimonDanisch commented 6 years ago

I have the same package version. Will try with julia 0.6.2 (I had 0.6.1 so far)

SimonDanisch commented 6 years ago

Ah, I can reproduce it - seems to be about glfw ( I actually wasn't on exactly the same version)

SimonDanisch commented 6 years ago

I get it..For the future, could you open new issues for unrelated problems? Your issue isn't about the filter changes, but since it's under the same issue, I assumed that ;)

GLFW is undergoing quite drastic changes... I'd suggest to just pin it to Pkg.pin("GLFW", v"1.4.1")