Giter VIP home page Giter VIP logo

kivyglops's People

Contributors

poikilos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kivyglops's Issues

Physics is not working. The player sticks to a nearby object and can fly due to the interaction stopping physics.

Code checked

  • "constrained" doesn't occur when bug occurs
  • walk_info doesn't move the character significantly in one frame
    • happens regardless of whether walkmesh_enable is True or False.

Commits related to the bug

  • A phrase in all caps indicates the status of the bug in the commit.
  • "NOT PRESENT" indicates that the specific issue is not present (Other issues may be present).

Tested using example-stadium.py

  • 2018-01-12 (NOT PRESENT) 274b739
  • 2018-01-13 (NOT PRESENT) 3a66898
    • unrelated note: This is the last version tested with learners
    • Textures are missing because /meshes/stadium,primitive.mtl uses absolute paths (due to a Blender export issue apparently). This is noted in the list of differences below.
    • Only some data files and code unrelated to the test differ from the version tested with learners apparently. The git version differs as follows:
      • Added missing medseaport1b-crate.mtl, etc/unused/prealpha-opengl9-process_ai.png
      • Added testing.py
      • Added testingkivy3d.py
      • Added deploy*.bat
      • Added extraneous Cylinder_Cylinder.001.pyglop
      • Changed pyglops.py inconsequentially (There is an extra line of debug output if get_verbose_enable()).
      • Changed README.md, etc/deltakivyglops.py, etc/deprecated.md, several etc/stadium* files
      • Fixes meshes/stadium,primitive.mtl
  • 2018-01-14 (UNKNOWN: can't walk) 9f43bc3 working on physics
    • adds huge section starting with:
        #region choice-based movement and physics
        # --in that order, so you don't go through stuff
        got_frame_delay = 0.0  # do NOT move this to anywhere before hit
                               # detection is finished--otherwise
                               # invisible movement could occur (ones
                               # using got_frame_delay) before hit
                               # detection
        if self.last_update_s is not None:
            got_frame_delay = best_timer() - self.last_update_s
        self.last_update_s = best_timer()
        for index in range(len(self.glops)):
            motivated_glop = self.glops[index]
            theta = None
            lups = None
  • 2018-01-14 (NOT CHECKED: has no code changes; remove media with license issues)
    • cd452cc "updated README"
    • 371b91b "made licensing compatible with new GitHub TOS"
  • 2018-01-15 (PARTIALLY PRESENT? player is sometimes underground until rotated, maybe dependent on mouse position; jumps when moved and gets stuck in the air; monkey is hidden but not stuck to player apparently) 1b04090 "working on physics and PEP8"
  • 2018-01-15 (UNKNOWN: invalid syntax kivyglops line 535) 8c8e881 "PEP8 changes"
  • 2018-01-16 (PRESENT: can fly, but sometimes only after clicking (and hit ground sound tries to play); starts underground until moved sometimes; not stuck to monkey; monkey seems to be underground (or not visible)) 88efe79 "working on settings dict"
  • 2018-01-17 (PRESENT: can fly but even gets stuck at a certain xz point after moving if in air--can only move on y; the chimp isn't visible) eff9592 "pep8 changes"
    • to get it running, change continue to return None in calculate_hit_range
  • 2018-01-17 (UNKNOWN: has indentation errors) 7da5335 "working on physics"
  • 2018-01-17 (UNKNOWN: has indentation errors) 633b51c "working on physics"
  • 2018-01-18 (PRESENT? I teleport to the chimp when I try to move, can't see up or down, can't see chimp, can only rotate at a constant speed) ad87de9 "refactoring"
  • 2019-01-18 (PRESENT? I teleport to the chimp when I try to move) 9d3b64f "working on geometry"

Comparing

1b04090 vs ad87de9

They are very divergent due to PEP8 changes.

Related issues

The code for debug_dict is brittle. KeyError: 'View' occurs when TAU is not present.

Failing to import TAU in __init__.py somehow removes 'View' without first raising an exception.

[INFO   ] [Logger      ] Record log in /home/owner/.kivy/logs/kivy_21-02-03_101.txt
[INFO   ] [Kivy        ] v2.0.0
[INFO   ] [Kivy        ] Installed at "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.1 (default, Dec  8 2020, 00:00:00) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)]
[INFO   ] [Python      ] Interpreter at "/home/owner/kivy_venv/bin/python3"
[INFO   ] [Factory     ] 186 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'3.0 Mesa 20.3.3'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel Open Source Technology Center'>
[INFO   ] [GL          ] OpenGL renderer <b'Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2)'>
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <b'1.30'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Audio       ] Providers: audio_sdl2 (audio_ffpyplayer ignored)
[ kivyglops.py ] default _multicontext_enable: False
[ KivyGlopsWindow ] default shader has been set to 'shaders/kivyglops-singlecontext.glsl'
[INFO   ] [Shader      ] Read </home/owner/git/KivyGlops/shaders/kivyglops-singlecontext.glsl>
[INFO   ] [Text        ] Provider: sdl2
human-5ft4-7.5-poikilos.obj (609,0): (PARSER WARNING) vertex texcoord_number is None when adding to face
(this is the last texcoord_number warning that will be shown for this input file)

added face to 'player5ft4' face list key '8683f458-d466-4897-8309-962b4244fa93': [[0, None, 0], [1, None, 0], [2, None, 0], [3, None, 0]]
human-5ft4-7.5-poikilos.obj: object named player5ft4...312 face(s)
human-5ft4-7.5-poikilos.obj: object named Plane...598 face(s)
[ WObjFile ] 'human-5ft4-7.5-poikilos.obj' has a total of 933 vertices loaded as 933 vertices
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlops ] (load_obj) applying pivot point for player5ft4...
[ KivyGlops ] (load_obj) applying pivot point for Plane...
[ KivyGlops ] (load_obj) Loaded 'meshes/human-5ft4-7.5-poikilos.obj' in 0.3273097909986973 seconds.
[ KivyGlops ] WARNING in __init__: got 2 meshes from meshes/human-5ft4-7.5-poikilos.obj so picked player5ft4 for player_glop
    done calculate_hit_range
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available
added face to 'Walkmesh_Plane.001' face list key '1': [[0, 0, 0], [1, 1, 1], [2, 2, 2]]
stadium,primitive.obj: object named Walkmesh_Plane.001...2163 face(s)
stadium,primitive.obj: object named Chimp_Suzanne...884 face(s)
stadium,primitive.obj: object named Rock.024_Icosphere.024...80 face(s)
stadium,primitive.obj: object named Rock.023_Icosphere.023...80 face(s)
stadium,primitive.obj: object named Rock.022_Icosphere.022...80 face(s)
stadium,primitive.obj: object named Rock.021_Icosphere.021...80 face(s)
stadium,primitive.obj: object named Rock.020_Icosphere.020...80 face(s)
stadium,primitive.obj: object named Rock.019_Icosphere.019...80 face(s)
stadium,primitive.obj: object named Rock.018_Icosphere.018...80 face(s)
stadium,primitive.obj: object named Rock.017_Icosphere.017...80 face(s)
stadium,primitive.obj: object named Rock.016_Icosphere.016...80 face(s)
stadium,primitive.obj: object named Rock.015_Icosphere.015...80 face(s)
stadium,primitive.obj: object named Rock.014_Icosphere.014...80 face(s)
stadium,primitive.obj: object named Rock.013_Icosphere.013...80 face(s)
stadium,primitive.obj: object named Rock.012_Icosphere.012...80 face(s)
stadium,primitive.obj: object named Rock.011_Icosphere.011...80 face(s)
stadium,primitive.obj: object named Rock.010_Icosphere.010...80 face(s)
stadium,primitive.obj: object named Rock.009_Icosphere.009...80 face(s)
stadium,primitive.obj: object named Rock.008_Icosphere.008...80 face(s)
stadium,primitive.obj: object named Rock.007_Icosphere.007...80 face(s)
stadium,primitive.obj: object named Rock.006_Icosphere.006...80 face(s)
stadium,primitive.obj: object named Rock.005_Icosphere.005...80 face(s)
stadium,primitive.obj: object named Rock.004_Icosphere.004...80 face(s)
stadium,primitive.obj: object named Rock.003_Icosphere.003...80 face(s)
stadium,primitive.obj: object named Rock.002_Icosphere.002...80 face(s)
stadium,primitive.obj: object named Rock.001_Icosphere.001...80 face(s)
stadium,primitive.obj: object named Rock_Icosphere...80 face(s)
stadium,primitive.obj: object named Ground_Plane...4225 face(s)
stadium,primitive.obj (39913,0): (INPUT ERROR) bad polyline skipped (should have absolute counting number of existing vertex from 'v' command in file)
stadium,primitive.obj: object named BezierCurve...WARNING: got None for this_object.face_groups!
stadium,primitive.obj: object named Stands_Plane.003...4952 face(s)
[ WObjFile ] 'stadium,primitive.obj' has a total of 11305 vertices loaded as 11305 vertices
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
[ KivyGlop ] WARNING in calculate_hit_range: eye_height 1.7 is beyond phi_eye_height-92.7415805 so is being set to that value
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
[ KivyGlop ] WARNING in calculate_hit_range: eye_height 1.7 is beyond phi_eye_height-108.2261185 so is being set to that value
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
WARNING in append_wobject: ignoring wobject where face_groups is None (a default face group is made on load if did not exist).
[ KivyGlop ] (verbose message in _on_change_pivot) from (0.0, 0.0, 0.0)
    done calculate_hit_range
[ KivyGlops ] (load_obj) applying pivot point for Walkmesh_Plane.001...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-dirt,dry1.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Chimp_Suzanne...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-chimp.png'
[ KivyGlops ] (load_obj) applying pivot point for Rock.024_Icosphere.024...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[INFO   ] [GL          ] Unpack subimage support is available
[ KivyGlops ] (load_obj) applying pivot point for Rock.023_Icosphere.023...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.022_Icosphere.022...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.021_Icosphere.021...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.020_Icosphere.020...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.019_Icosphere.019...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.018_Icosphere.018...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.017_Icosphere.017...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.016_Icosphere.016...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.015_Icosphere.015...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.014_Icosphere.014...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.013_Icosphere.013...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.012_Icosphere.012...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.011_Icosphere.011...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.010_Icosphere.010...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.009_Icosphere.009...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.008_Icosphere.008...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.007_Icosphere.007...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.006_Icosphere.006...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.005_Icosphere.005...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.004_Icosphere.004...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.003_Icosphere.003...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.002_Icosphere.002...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock.001_Icosphere.001...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Rock_Icosphere...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) applying pivot point for Ground_Plane...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-dirt,dry1.jpg'
[ KivyGlops ] (load_obj) applying pivot point for ...
[ PyGlop ] WARNING in apply_vertex_offset:  self.vertices is None for None
[ KivyGlop ] WARNING: vertices is None in glop None
[ KivyGlops ] (load_obj) applying pivot point for Stands_Plane.003...
[ KivyGlop ] Loaded texture '/home/owner/git/KivyGlops/meshes/stadium,primitive-bricks,natural_gray.jpg'
[ KivyGlops ] (load_obj) Loaded 'meshes/stadium,primitive.obj' in 16.41733917297097 seconds.
[ example-stadium ] WARNING: not using walkmesh
Preparing item at index 5
Preparing item at index 6
Preparing item at index 7
Preparing item at index 8
Preparing item at index 9
Preparing item at index 10
Preparing item at index 11
Preparing item at index 12
Preparing item at index 13
Preparing item at index 14
Preparing item at index 15
Preparing item at index 16
Preparing item at index 17
Preparing item at index 18
Preparing item at index 19
Preparing item at index 20
Preparing item at index 21
Preparing item at index 22
Preparing item at index 23
Preparing item at index 24
Preparing item at index 25
Preparing item at index 26
Preparing item at index 27
Preparing item at index 28
Preparing item at index 29
    done calculate_hit_range
Found 1 chimp(s)
    done calculate_hit_range
[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "/home/owner/git/KivyGlops/example-stadium.py", line 145, in <module>
     KivyGlopsExampleApp().run()
   File "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/app.py", line 950, in run
     runTouchApp()
   File "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/base.py", line 582, in runTouchApp
     EventLoop.mainloop()
   File "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/base.py", line 347, in mainloop
     self.idle()
   File "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/base.py", line 387, in idle
     Clock.tick()
   File "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/clock.py", line 733, in tick
     self.post_idle(ts, self.idle())
   File "/home/owner/kivy_venv/lib64/python3.9/site-packages/kivy/clock.py", line 776, in post_idle
     self._process_events()
   File "kivy/_clock.pyx", line 616, in kivy._clock.CyClockBase._process_events
   File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
   File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
   File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
   File "/home/owner/git/KivyGlops/kivyglops/__init__.py", line 3815, in update_glsl
     debug_dict['View']['camera xyz: '] = \
 KeyError: 'View'

Simulate smoke using solid shapes.

Large-scale smoke

  • Use spheres of different sizes (splitting into more & shrinking?)
  • The smoke gets wider as it goes up.
  • Change the UV mapping gradually so it reaches a transparent part of the texture eventually--use a large texture that becomes transparent at the top.

Small-scale smoke

Realistic small scale smoke may be possible the same way as large-scale smoke (using a texture that is transparent at the top) with changes, possibly such as:

  • Use very long spheres that get warped along curves.
  • Make the entire texture slightly transparent.

Add this Python 3.8-like dist function.

def dist(posA, posB):
    '''
    Calculate the distance of any dimensionality as math.dist does since
    math.dist isn't available until Python 3.8 (not on Debian 10 Buster)
    '''
    aLen = 1
    bLen = 2
    origPosA = posA
    origPosB = posB
    try:
        aLen = len(posA)
    except TypeError:
        posA = [posA]
    try:
        bLen = len(posB)
    except TypeError:
        posB = [posB]
    if aLen != bLen:
        raise ValueError("The points must have the same number of"
                         " dimensions, but the points are: {} and {}"
                         "".format(origPosA, origPosB))
    for i in range(aLen):
        total += (posB[i] - posA[i]) ** 2
    return math.sqrt(total)

Make per-object variables (rather than uniform which is the same from glStart to glEnd or per-vertex which is too fine)

Is there a way to add a uniform (accessible to shader) other than canvas["something"]? I have to make it only for InstructionGroup or PushMatrix so it is specific to one Mesh (because I am working on a 3D viewport).
The reason why is clear here: https://github.com/expertmm/KivyGlops/blob/master/shaders/fresnel.glsl#L67
(There was no shorter or one-file example I could imagine)
related python code is here: https://github.com/expertmm/KivyGlops/blob/master/kivyglops.py#L678
KivyGlop is a subclass of widget but to get it working I had to set canvas to InstructionGroup() as advised on kivy IRC channel, so I can't set the uniform like canvas["texture0_enable"] anymore
(except for the parent canvas, but that is not helpful since I need the uniform to apply to only one Mesh)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.