-
Notifications
You must be signed in to change notification settings - Fork 34
bug in 2d lines #47
Comments
Is N very big? Because then the points would be outside the window area... |
It is small, N=10 Defining this function function plot(m)
srand(17)
w, r = glscreen()
@async r()
s = Vec2f0(50)
N = 10
v_pos = Point2f0[Point2f0((N*s[1]*rand(2))...) for i=1:N]
v_img = HyperSphere(Point2f0(0), 30f0)
vis_nodes = visualize((v_img, v_pos), :lines, scale=s)
view(vis_nodes, method=:orthographic_pixel)
# m used here
v = visualize(v_pos[1:m], :lines, scale=s)
view(v, method=:orthographic_pixel)
end I obtain |
I guess your problem is that the primitives are not centered? |
Oh yes, that was a problem, but the real problem is that with plot(3) I was expecting to see two segments |
Ah yeah... That's actually what I wanted to work on today. That's a peculiarity of OpenGL and I want to make a proper work around and fix another issue while at it (being able to add a list of indexes and specifying which points are connected). The only work around you can use right away is, to never have less than 4 points... a,b = points
ab = b-a
points = vcat(a-(ab*0.00001f0),a,b,b+(ab*0.00001f0)) #start and end have to be slightly different |
ok thanks. As an alternative, there is a way to visualize types from GeometryTypes.jl, like LineSegment? |
that's exactly what I need to visualize a graph |
Well, that's basically what I will be implementing. |
Great! I can't promise anything, but I'm working on it ;) |
Okay I fixed the line endings and made a step forward towards the segments ;) I just need to integrate a few changes into the rest of the infrastructure to make it work for the generic case. |
uh...have you removed |
ouch, right, sorry, it works perfectly! |
@SimonDanisch |
that's a julia/github issue. Sometimes it helped to first do git checkout sd/typealias You might need to throw in a: git reset --hard HEAD If there have been changes in the sources. |
I'm trying to plot a graph using GLVisualize, and I was trying to display an edge as a line, that is something like
but all I get is a blank window. I'm on
next2
branchThe same goes for
v = visualize(v_pos[1:3], :lines, scale=s)
while for 4 or more the piecewise line is displayed correctly.PS
I tried to
view
aLineSegment
from GeometryTypes but it didn't worked outPPS
I've in mind to write something like
Since I'm new to GLVisualize (and to graphics in general) probably I"m doing it wrong, any suggestion is appreciated
The text was updated successfully, but these errors were encountered: