electronstudio / rlzero

A simplified API for Raylib to enable beginners to create 3d games
Eclipse Public License 2.0
24 stars 1 forks source link

Better documentation needed to cover installation process #2

Open iilyak opened 2 years ago

iilyak commented 2 years ago

After doing pip3 install rlzero and creating a test.py I try to run it like python test.py.

My environment:

The error I get

> MINGW64 ~/Documents/Code/CodeKids/rlzero (master)
$ python test.py 
RAYLIB STATIC 4.2.0.0 LOADED
INFO: Initializing raylib 4.2
INFO: Supported raylib modules:
INFO:     > rcore:..... loaded (mandatory)
INFO:     > rlgl:...... loaded (mandatory)
INFO:     > rshapes:... loaded (optional)
INFO:     > rtextures:. loaded (optional)
INFO:     > rtext:..... loaded (optional)
INFO:     > rmodels:... loaded (optional)
INFO:     > raudio:.... loaded (optional)
INFO: DISPLAY: Trying to enable VSYNC
INFO: DISPLAY: Device initialized successfully
INFO:     > Display size: 1920 x 1080
INFO:     > Screen size:  1 x 1
INFO:     > Render size:  1 x 1
INFO:     > Viewport offsets: 0, 0
INFO: GLAD: OpenGL extensions loaded successfully
INFO: GL: Supported extensions count: 305
INFO: GL: OpenGL device information:
INFO:     > Vendor:   ATI Technologies Inc.
INFO:     > Renderer: AMD Radeon(TM) Graphics
INFO:     > Version:  3.3.14761 Core Profile Context 21.30.02.15 30.0.13002.15001
INFO:     > GLSL:     4.60
INFO: GL: DXT compressed textures supported
INFO: GL: ETC2/EAC compressed textures supported
INFO: TEXTURE: [ID 1] Texture loaded successfully (1x1 | R8G8B8A8 | 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Vertex shader compiled successfully
INFO: SHADER: [ID 2] Fragment shader compiled successfully
INFO: SHADER: [ID 3] Program shader loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)
INFO: RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)
INFO: RLGL: Default OpenGL state initialized successfully
INFO: TEXTURE: [ID 2] Texture loaded successfully (128x128 | GRAY_ALPHA | 1 mipmaps)
INFO: FONT: Default font loaded successfully (224 glyphs)
INFO: AUDIO: Device initialized successfully
INFO:     > Backend:       miniaudio / WASAPI
INFO:     > Format:        32-bit IEEE Floating Point -> 32-bit IEEE Floating Point
INFO:     > Channels:      2 -> 2
INFO:     > Sample rate:   48000 -> 48000
INFO:     > Periods size:  1440
INFO: FILEIO: [C:\Users\iilyak\Documents\Code\CodeKids\rlzero\rlzero\basic_lighting.vs] Text file loaded successfully
INFO: FILEIO: [C:\Users\iilyak\Documents\Code\CodeKids\rlzero\rlzero\basic_lighting.fs] Text file loaded successfully
INFO: SHADER: [ID 4] Vertex shader compiled successfully
INFO: SHADER: [ID 5] Fragment shader compiled successfully
INFO: SHADER: [ID 6] Program shader loaded successfully
INFO: SHADER: [ID 6] Shader attribute (vertexPosition) set at location: 0
INFO: SHADER: [ID 6] Shader attribute (vertexTexCoord) set at location: 1
WARNING: SHADER: [ID 6] Failed to find shader attribute: vertexTexCoord2
INFO: SHADER: [ID 6] Shader attribute (vertexNormal) set at location: 2
WARNING: SHADER: [ID 6] Failed to find shader attribute: vertexTangent
INFO: SHADER: [ID 6] Shader attribute (vertexColor) set at location: 3
INFO: SHADER: [ID 6] Shader uniform (mvp) set at location: 23
WARNING: SHADER: [ID 6] Failed to find shader uniform: matView
WARNING: SHADER: [ID 6] Failed to find shader uniform: matProjection
INFO: SHADER: [ID 6] Shader uniform (matModel) set at location: 22
WARNING: SHADER: [ID 6] Failed to find shader uniform: matNormal
INFO: SHADER: [ID 6] Shader uniform (colDiffuse) set at location: 1
INFO: SHADER: [ID 6] Shader uniform (texture0) set at location: 25
WARNING: SHADER: [ID 6] Failed to find shader uniform: texture1
WARNING: SHADER: [ID 6] Failed to find shader uniform: texture2
INFO: SHADER: [ID 6] Shader uniform (matModel) set at location: 22
INFO: SHADER: [ID 6] Shader uniform (viewPos) set at location: 24
INFO: SHADER: [ID 6] Shader uniform (ambient) set at location: 0
INFO: SHADER: [ID 6] Shader uniform (lights[0].enabled) set at location: 2
INFO: SHADER: [ID 6] Shader uniform (lights[0].type) set at location: 6
INFO: SHADER: [ID 6] Shader uniform (lights[0].position) set at location: 10
INFO: SHADER: [ID 6] Shader uniform (lights[0].target) set at location: 14
INFO: SHADER: [ID 6] Shader uniform (lights[0].color) set at location: 18
INFO: TIMER: Target time per frame: 16.667 milliseconds
Traceback (most recent call last):
  File "C:\Users\iilyak\Documents\Code\CodeKids\rlzero\test.py", line 8, in <module>
    cube = Cube((0, 10, 0), (10, 20, 10), BLUE)
  File "C:\Users\iilyak\Documents\Code\CodeKids\rlzero\rlzero\Model.py", line 195, in __init__   
    super().__init__(model_file="", pos=pos, rotation_axis=rotation_axis,
  File "C:\Users\iilyak\Documents\Code\CodeKids\rlzero\rlzero\Model.py", line 54, in __init__    
    self.wire_color = wire_color
  File "C:\Users\iilyak\Documents\Code\CodeKids\rlzero\rlzero\shape.py", line 47, in wire_color  
    self._wire_color = Color(value)
NameError: name 'Color' is not defined

I think I am missing some dependency. But it is not clear what.

iilyak commented 2 years ago

It seems the Color class was removed in https://github.com/electronstudio/rlzero/commit/e4d94ac584baf2f6bbc7ec3f77e986f3a81c2187

electronstudio commented 2 years ago

All the 3d stuff is quite a mess at the moment I'm afraid. (the test.py is 3d) The 2d stuff is mostly working and is documented at https://electronstudio.github.io/python_book

electronstudio commented 2 years ago

I've fixed the color enums so the test.py should now work. Please pip3 install rlzero==0.4.2

electronstudio commented 2 years ago

Some of the content in the book might need updating to work with 0.4.2 but generally I have used it for teaching so it should be OK. If it isn't, report and I will fix. The 3d stuff isn't documented or ready for use in teaching. I don't have much time to work on it since I'm not teaching now.