Go to advanced search

by paddyg
Fri Aug 23, 2019 7:38 pm
Forum: Python
Topic: python 2 end of life
Replies: 9
Views: 348

Re: python 2 end of life

Sadly I don't think there is a simple solution. And the RPi approach is really "everyone's a command line user", even very basic tutorials start out with "open a terminal and type..." followed by possible misapplication of pip v. pip3 or python-xmodule v. python3-xmodule etc etc. Maybe what's needed...
by paddyg
Fri Aug 23, 2019 11:27 am
Forum: Python
Topic: python 2 end of life
Replies: 9
Views: 348

Re: python 2 end of life

I posted on the topic a while ago with a rather hyperbolic title including the word 'emergency'. However I do think that something more proactive is needed beyond warnings. Most people starting to program will just use 'python' without worrying about the finer points. I think the maintainers of rasp...
by paddyg
Sun Aug 18, 2019 9:02 am
Forum: Python
Topic: Pi3D
Replies: 244
Views: 35162

Re: Pi3D

Yes python is quick and forgiving for just checking things out. Errors in GLSL code are quite hard to track down - often there's no error message at all! I've found that the the GL driver on the RPi4 is more of a stickler for the letter of the law than the equivalent on my laptop. So after getting t...
by paddyg
Thu Aug 08, 2019 10:34 am
Forum: Python
Topic: How do i debug my code of python 3.5 ?
Replies: 6
Views: 234

Re: How do i debug my code of python 3.5 ?

Well I'm still not *completely* sure what you mean because I can't see your circuit to determine whether high or low turns the led on, but, assuming that by "condition satisfied" you mean "abs(rbuff[0] - temp) <= 2" I might approach it like this LED_TM = 10 led_state = False last_led_state = False l...
by paddyg
Tue Aug 06, 2019 8:32 am
Forum: Python
Topic: How do i debug my code of python 3.5 ?
Replies: 6
Views: 234

Re: How do i debug my code of python 3.5 ?

Hi, I'm not sure if this helps but here's your code with non-essentials and duplication stripped away. It doesn't make much sense to me as I don't know what you are trying to do! if flag == 4 and count == 28: ser.write(rbuff) lcd_string(str(rbuff), LCD_LINE_2, 2) count = 0 flag = 0 pin18 = GPIO.LOW ...
by paddyg
Sat Jul 27, 2019 1:14 pm
Forum: Python
Topic: seeking 2D graphics engine for Python
Replies: 10
Views: 334

Re: seeking 2D graphics engine for Python

Following from my initial suggestion I tried building https://github.com/mickelson/sfml-pi following the README I don't know if it works as I haven't installed anything that might use it (examples and tests a bit unclear) @aardvarkkrill could try this with their existing projects and see if it works...
by paddyg
Fri Jul 26, 2019 9:21 pm
Forum: Python
Topic: seeking 2D graphics engine for Python
Replies: 10
Views: 334

Re: seeking 2D graphics engine for Python

Just checking that you selected the fake kms graphics driver and ran it with x11 server up? The code in the link you posted won't work if it thinks it's running on the RPi (if it's RPi4 as it loads libbcm.so) but if you can make it think you're running on linux x11 system it probably possibly will (...
by paddyg
Fri Jul 26, 2019 11:20 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

I understood that it is possible to not use X see https://www.raspberrypi.org/forums/view ... 8&t=243707 using kmscube but the prospect of making all that C code usable from python or Rust isn't very appealing!
by paddyg
Fri Jul 26, 2019 10:24 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

fps_pivot.jpg Here are some comparisons. The RPi4 is always faster (apart from PictureFrame_new from the desktop - TODO check why!?) and generally on the older RPis it's a bit, or much , faster to use the old bcm driver and not run X11 if that's possible. However I've not tried setting up a system ...
by paddyg
Tue Jul 23, 2019 8:15 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

I think Tim has. It will probably run as is without recompiling as it hangs off SDL2 and loads the GL drivers at start. Certainly my Rust version "just worked" (there is no point or line rendering in that demo!). I will check out the FPS later. It might make more difference to Tim's version as it ha...
by paddyg
Mon Jul 22, 2019 1:45 pm
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Gavin, I pushed the revised Rust version to github last night. Seems to whiz along on the RPi4. Also added the missing assets from my version of Tim Skillmans ship_demo. PeterO, I'm not sure about the documentation in the gl crate or how much hasn't been implemented, as I really just took the pi3d c...
by paddyg
Mon Jul 22, 2019 12:58 pm
Forum: Graphics programming
Topic: Documentation for VC6
Replies: 28
Views: 1408

Re: Documentation for VC6

When I posted my plea for help getting RPi4 point and lines drawing working on stackoverflow Eric did reply pretty promptly so that was reassuring. Didn't help me solve the issue though..
by paddyg
Sun Jul 21, 2019 7:14 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Yes that's exactly the reason (CW triangles as opposed to CCW). At some point in the past (I like to think before I was involved) the meshes in pi3d got defined as clockwise => forward but with matching normal vectors so was self consistent. At a later stage, the (probably my) hack to improve render...
by paddyg
Sat Jul 20, 2019 7:34 pm
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Hi, found the problem. It was the line

Code: Select all

glCullFace(GL_FRONT)
which I set as standard at the start of pi3d but which seems to stop rendering points and lines only on Raspberry Pi 4 - not sure if it's a feature!
Phew.. now I need to update pi3d and push out the next version.

Paddy
by paddyg
Sat Jul 20, 2019 8:01 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Gavin, thanks for that. I've also narrowed the problem down to something I've caused . I've tested using the PyOpenGL module and see that points and lines render fine ( see my github ). I now have to work my way through and see where the fault is :( - probably a type that's wrong, or defaults to som...
by paddyg
Fri Jul 19, 2019 12:32 pm
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Gavin, thanks for testing this, it narrows the problem down to something to do with the way I'm rendering! glPointSize isn't available in OpenGLES so I glEnable(GL_PROGRAM_POINT_SIZE) to avoid having conditional bits of code depending on the machine it's running on. However If I load the OpenGL driv...
by paddyg
Thu Jul 18, 2019 9:51 pm
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Update: here's some minimal code to show the problem https://github.com/paddywwoof/test_rpi4 and here's a video of it running on different machines https://youtu.be/eyDMb4VVIgk It's probably something obvious but I can't spot it!
by paddyg
Sun Jul 14, 2019 11:40 am
Forum: OpenGLES
Topic: OpenGL on Buster on both Pi 3 and Pi 4
Replies: 68
Views: 5064

Re: OpenGL on Buster on both Pi 3 and Pi 4

@Brian_Beuken, is the screen shot above from the RPi4? I can't get lines or points to render so I would be keen to see how you are doing it, if the code is available to view somewhere.

Paddy
by paddyg
Sun Jul 14, 2019 11:34 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

Thanks. The GL_POINTS drawing works pretty well apart from on the RPi4, though I did have to add a couple of tweaks to get the rust code to draw points (that were bigger than 1px). Basically had to glEnable(GL_PROGRAM_POINT_SIZE) and glEnable(GL_POINT_SPRITE) also I had to specify #version 120 in th...
by paddyg
Sun Jul 14, 2019 8:20 am
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

Re: RPi4 Problem drawing GL_POINTS anyone?

gavin, pik, thanks. My code seems to work fine as far as I can see (After switching libbcm to libX11. All tests run, appearance is good and speed is a bit faster) but no points or lines. As I said, the same code works on previous RPis as well as linux and windows x86. I suppose I'm specifically look...
by paddyg
Sat Jul 13, 2019 10:49 pm
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 30
Views: 1318

RPi4 Problem drawing GL_POINTS anyone?

Has anyone either drawn points without any issues or run into problems with the same code that works OK on previous versions? If I put a buster SD card (which works fine in RPi3) into a RPi4 I'm missing the points. (If I switch to the legacy shader the rust code shows points but runs very slowly, th...
by paddyg
Wed Jul 10, 2019 10:44 pm
Forum: Python
Topic: timestamp using GPS - NMEA
Replies: 2
Views: 136

Re: timestamp using GPS - NMEA

If the string is a byte array (which is a bit of a muddle in python2 but hopefully you are using python3) then you can split it into bits using slice notation i.e. tm = b'220501' h = tm[0:2] m = tm[2:4] etc those values will be byte arrays too but you can convert them to integers h = int(tm[0:2]) et...
by paddyg
Wed Jul 03, 2019 10:07 pm
Forum: Python
Topic: PI3D - Rotating around local axis
Replies: 7
Views: 1603

Re: PI3D - Rotating around local axis

Chris & @cowminer27, I think setting absolute=True would make the rotation about y axis act on the world vertical axis and rotation about the x axis act on the horizonal axis (horizontal in world space, but rotated with camera rotation about vertical axis) To test this (in ForestWalk with absolute=T...
by paddyg
Wed Jun 19, 2019 8:00 pm
Forum: Python
Topic: Problem with function set_background or set_material in pi3d
Replies: 3
Views: 361

Re: Problem with function set_background or set_material in pi3d

glad you sorted it. It is a bit inconsistent but the reason it evolved that way is because the GPU colour and alpha values are floats 0.0 to 1.0 so the numbers you feed into Display.create() just get passed on in opengles functions. Textures, however, generally get their values from image files or P...
by paddyg
Tue Jun 18, 2019 8:45 am
Forum: Python
Topic: Importing python code from a sub-folder
Replies: 6
Views: 329

Re: Importing python code from a sub-folder

The 'neateast' way is probably using python module structure but it's additional complexity if you've not worked with modules before.

Go to advanced search