Go to advanced search

by paddyg
Sat Jul 20, 2019 7:34 pm
Forum: OpenGLES
Topic: RPi4 Problem drawing GL_POINTS anyone?
Replies: 16
Views: 378

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: 16
Views: 378

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: 16
Views: 378

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: 16
Views: 378

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: 66
Views: 2792

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: 16
Views: 378

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: 16
Views: 378

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: 16
Views: 378

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: 94

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: 1557

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: 347

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: 306

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.
by paddyg
Mon Jun 17, 2019 2:55 pm
Forum: Python
Topic: Snap an object to the camera in pi3d
Replies: 2
Views: 188

Re: Snap an object to the camera in pi3d

Good question, and also a good - not so obvious - reason for Unity's system of structuring GameObjects, Rigidbodies etc. In pi3d the Camera object doesn't have the GameObject functionality that Shape class has i.e. the parent/child hierarchy. This is because, under the skin, the matrices for convert...
by paddyg
Fri Jun 14, 2019 11:07 am
Forum: Python
Topic: [Solved] Is it possible to control OMXplayer based on time in Python?
Replies: 4
Views: 319

Re: Is it possible to control OMXplayer based on time in Python?

Hi, back at a normal computer now so can type more than one garbled sentence! I'm not sure the most efficient way to do the non-blocking key input. I've used curses in the past which is pretty easy but sometimes seems to produce odd side-effects. As you intend to do this with GPIO input in your 'pro...
by paddyg
Wed Jun 12, 2019 9:05 pm
Forum: Python
Topic: [Solved] Is it possible to control OMXplayer based on time in Python?
Replies: 4
Views: 319

Re: Is it possible to control OMXplayer based on time in Python?

Not got a computer so can't really look at your code properly but does your input() block execution until it gets an enter key?
by paddyg
Sun Jun 02, 2019 1:05 pm
Forum: Python
Topic: controlling number of times loop is executed?
Replies: 12
Views: 781

Re: controlling number of times loop is executed?

I don't think python 2 has built in symbolic maths (but might be wrong) so it must be built in formatting in the implementation of print. Normally that's good but sometimes it might be bad so they changed it... The python3 version is probably what the floats actually are, so less scope for confusion.
by paddyg
Sun Jun 02, 2019 12:43 pm
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1665

Re: Emergency Action Required by RPi Foundation

OK I admit it's not really an emergency as such. It's just that an awful lot of people getting into 'making' aren't coders and choose python because it's accessible and (relatively) easy to get the hang of. A non-negligible proportion of questions I've answered on this forum and elsewhere have had t...
by paddyg
Sun Jun 02, 2019 11:35 am
Forum: Python
Topic: Trying to make a speedometer using hall effect sensor and a neodym magnet
Replies: 7
Views: 345

Re: Trying to make a speedometer using hall effect sensor and a neodym magnet

I once had one of those wheels where the hub rotates at a different frequency from the rim, but I was flying through the air at the time so couldn't study it. The wheel was a write-off but I escaped with only a broken finger.
by paddyg
Sat Jun 01, 2019 4:51 pm
Forum: Python
Topic: Little help needed to convert a date string
Replies: 4
Views: 303

Re: Little help needed to convert a date string

I tend to use time.localtime() which has tm_year, tm_mon etc that you can use as you want, along the lines of

Code: Select all

dt = time.time() - 7 * 24 * 3600
dt_s = time.localtime(dt)
print("seven days ago would be {}:{}:{}".format(dt_s.tm_year, dt_s.tm_mon, dt_s.tm_mday))
by paddyg
Sat Jun 01, 2019 3:16 pm
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1665

Re: Emergency Action Required by RPi Foundation

So when I used the word lunacy I meant a policy that can say The long term goal for Debian is to reduce this to one stack, dropping the Python 2 stack at some time; the binary package python will represent the current default Debian Python 2 version Presumably that means that in the near future peop...
by paddyg
Sat Jun 01, 2019 2:50 pm
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1665

Re: Emergency Action Required by RPi Foundation

But on page 2 they say ``the binary package python will represent the current default Debian Python 2 version.`` how does that fit with their intention to just support the python3 stack!!?? But other flavours of linux ( redhat , arch , etc) don't necessarily follow the same line and python users don...
by paddyg
Sat Jun 01, 2019 2:15 pm
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1665

Emergency Action Required by RPi Foundation

see https://pythonclock.org/ I had assumed that, at some point early in 2019, typing ``python`` on the command line would stop producing python2 and start producing python3. Similarly ``pip`` would stop meaning pip2 and start meaning pip3, idle would mean idle3 etc etc. Presumably that's what will h...
by paddyg
Sat Jun 01, 2019 1:49 pm
Forum: Python
Topic: trouble adding a subset of matrix elements (numpy)
Replies: 13
Views: 672

Re: trouble adding a subset of matrix elements (numpy)

Essentially doesn't make any difference, in this case - sometimes the python syntax is quicker, sometimes slower! See import timeit setup = ''' import numpy as np a = np.random.rand(24_000) + np.random.rand(24_000) * 1j ''' fns = [''' b = a.real ** 2 + a.imag ** 2 ''', ''' c = np.add(np.square(a.rea...
by paddyg
Sat Jun 01, 2019 8:13 am
Forum: Python
Topic: trouble adding a subset of matrix elements (numpy)
Replies: 13
Views: 672

Re: trouble adding a subset of matrix elements (numpy)

Installing modules is the worst aspect of python by a long way: complicated by the fact that there are two incompatible versions maintained in parallel, and that the default (if you type 'python' on raspbian it uses python2) is not going to be supported in a few months time! Your data looks pretty c...
by paddyg
Fri May 31, 2019 11:42 pm
Forum: Python
Topic: trouble adding a subset of matrix elements (numpy)
Replies: 13
Views: 672

Re: trouble adding a subset of matrix elements (numpy)

Hi, that looks interesting. What are the characteristics of the data stream and the pulse? i.e. how much noise is there and can the pulse be determined by looking at a short length (10 values) or do you have to check that it remains high for 2048 values as you say? Is the pulse always relative to th...

Go to advanced search