Go to advanced search

by paddyg
Wed Jun 07, 2017 8:50 pm
Forum: Python
Topic: image viewer (pyhton)
Replies: 2
Views: 703

Re: image viewer (pyhton)

... but I haven't managed to get it to work with gpicview. You can also make image viewing things with tkinter, PyQt etc (my specific knowledge is pi3d which does the job using GPU)
by AshPowers
Tue Jun 06, 2017 11:08 pm
Forum: Python
Topic: PI3D - Use keyboard to open a new 2D "window".
Replies: 8
Views: 988

PI3D - Use keyboard to open a new 2D "window".

Trying to figure out what is going to be the best approach to this with PI3D. In my dashboard application which uses PI3D to display the gauges, needles, etc, I would like to be able to use the keyboard to load a configuration page over all of the gauges/needles ...
by AshPowers
Tue May 23, 2017 7:06 pm
Forum: Python
Topic: PI3D: Can the size of a Sprite be dynamically changed?
Replies: 4
Views: 472

Re: PI3D: Can the size of a Sprite be dynamically changed?

Paddy I want to marry you!

That worked perfectly. I ended up going to 1.5 on the correction (as the display is running 1080 and the image is only 720 high) and it works perfectly.

My God, you are a very powerful wizard! :)

-Ash
by paddyg
Tue May 23, 2017 5:55 pm
Forum: Python
Topic: PI3D: Can the size of a Sprite be dynamically changed?
Replies: 4
Views: 472

Re: PI3D: Can the size of a Sprite be dynamically changed?

If you have a non-moving Camera (shouldn't matter if 3D or not) then you can just add a line after you create it CAMERA.mtrx[1,1] *= 0.5 # this should be the correction factor If you move your Camera around and effectively reset it each frame then you need to do the same inside the while loop after ...
by paddyg
Tue May 23, 2017 7:18 am
Forum: Python
Topic: PI3D: Can the size of a Sprite be dynamically changed?
Replies: 4
Views: 472

Re: PI3D: Can the size of a Sprite be dynamically changed?

... that the scaling happens before rotation whereas you want it after. As you suggest the best way would be to alter the projection matrix which, in pi3d, is held by the Camera object, as this is then applied to all the Shapes as they are drawn. It is probably quite easy but involves a bit of investigation ...
by AshPowers
Tue May 23, 2017 1:49 am
Forum: Python
Topic: PI3D: Can the size of a Sprite be dynamically changed?
Replies: 4
Views: 472

Re: PI3D: Can the size of a Sprite be dynamically changed?

Or, if there is a simpler solution to this that is in PI3D that I am not aware of, that would be great. Can the display size be set in such a way that it will skew the image height of EVERYTHING displayed? The display wants to run 1920X1080 on a native ...
by AshPowers
Mon May 22, 2017 6:40 pm
Forum: Python
Topic: PI3D: Can the size of a Sprite be dynamically changed?
Replies: 4
Views: 472

PI3D: Can the size of a Sprite be dynamically changed?

Trying to determine if I need to rewrite my program and use textures rather than sprites for rotating gauge needles. Unfortunately the widebar 24:9 display simply will not run its native resolution and although I can rescale the background, the rotating needle sprites are short in vertical direction...
by AshPowers
Sun May 14, 2017 1:48 am
Forum: Troubleshooting
Topic: New Display: 1920X720. How to config?
Replies: 13
Views: 2077

Re: New Display: 1920X720. How to config?

... need to be added in to drive this display properly. Unfortunately there is no easy workaround for this problem on my end as my application uses pi3d and it is screwing up the scale of rotating sprite components. Circles look like wide ovals when running it in 1920X1440, for obvious reasons. ...
by paddyg
Wed May 10, 2017 6:53 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1960

Re: try: except: else: not acting right at all!!

people often eithe use a variable in the while loop so the ptogam can be stopped in a controlled way (as with the pi3d demos) You could do something like while msg != 'stop': or they put the whole loop in a try and tidy up in except keyboardinterrupt.
by AshPowers
Wed May 10, 2017 5:12 am
Forum: Python
Topic: pi3d: TextBlock data input failure
Replies: 1
Views: 250

Re: pi3d: TextBlock data input failure

Problem Solved:

The issue is in the formatting within the TextBlock definition. Characters coming from the phone are strings and the formatting in the TextBlock was expecting integer values.

text_format="{:4.0f}", size=0.50, spacing="C", space=.7,
by AshPowers
Wed May 10, 2017 2:46 am
Forum: Python
Topic: pi3d: TextBlock data input failure
Replies: 1
Views: 250

pi3d: TextBlock data input failure

... default uses the UTF-8 encoding as well. class EgClass(object): pterm = 0 eg_object = EgClass() BACKGROUND_COLOR = (0.0, 0.0, 0.0, 1.0) DISPLAY = pi3d.Display.create(background=BACKGROUND_COLOR) HWIDTH, HHEIGHT = DISPLAY.width / 2.0, DISPLAY.height / 2.0 QWIDTH = HWIDTH/2 # quarter width shader ...
by paddyg
Tue May 09, 2017 7:25 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1960

Re: try: except: else: not acting right at all!!

You could use one loop, putting your pi3d stuff in your serial reading loop or vice-versa but you would then need to make sure you didnt have any blocking reads or long sleeps. you would call loop_running() in the loop (ie it doesn't have to ...
by AshPowers
Tue May 09, 2017 12:43 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1960

Re: try: except: else: not acting right at all!!

If you look at the bottom of the code snippet I write, you will see the while DISPLAY.loop_running():. This is for pi3d and once the program gets to this loop, it runs in this loop forever, continually redrawing the screen. This is also where all of my data acquisition is occuring ...
by Douglas6
Tue May 09, 2017 12:14 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1960

Re: try: except: else: not acting right at all!!

I'm afraid I'm not familiar with Pi3d and it's display loop(?). You might need a separate thread, and/or a hook into the UI loop, if that's what it is.
by AshPowers
Mon May 08, 2017 11:31 pm
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1960

Re: try: except: else: not acting right at all!!

... for only around that timespan again. So I have tested your code in a new blank file and it works just as intended. Only issue is that I am using pi3d and the while DISPLAY.loop_running(): is running, that is where the entirety of the program runs in. I have been trying to figure out how to use ...
by AshPowers
Sat May 06, 2017 9:11 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

Re: pi3d - Sprites laying over textblock????

... the issue. Another ID ten T error. :P But it is good to know about the maximum number of characters parameter. The 13 character value used in the pi3d example fortunately is large enough to hold each of the data values so it never became an issue.. Lucky me! HA! :) Thanks again!
by paddyg
Sat May 06, 2017 8:35 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

Re: pi3d - Sprites laying over textblock????

Ash, I can't think of a specific limit for the number of TextBlocks you can add to one PointText object. In pi3d_demos.StringMulti.py there are 13 and it seems to work OK when I add several more. However when you create the PointText you have to specify the maximum number of ...
by AshPowers
Sat May 06, 2017 6:59 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

Re: pi3d - Sprites laying over textblock????

... feedback! Yes, I did get things sorted out with the bluetooth connection. Silly oversight on my part. However, I have come across something with pi3d again... Is there a limit to how many textblock items you can create? It seems that it will only allow 10. I've tried every way, and sideways, ...
by paddyg
Sat May 06, 2017 4:28 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

Re: pi3d - Sprites laying over textblock????

That dashboard looks amazing, it's really uplifting to see the stuff people do with the Raspberry Pi, especially if they've not been coding long (three weeks of python is very little to be fixing things like this). On your serial try catch question. You've probably sorted it out from douglas and dav...
by AshPowers
Sat May 06, 2017 12:43 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

Re: pi3d - Sprites laying over textblock????

Hi Paddy! I feel a bit starstruck! I've seen SO many of your posts since picking up this RPi3 three weeks ago and all of the searches I've done while picking up Python - immensly helpful!. :) I have been on this project some 200+ hours already in that time and over 300 lines of solid code in this au...
by paddyg
Sat May 06, 2017 12:42 pm
Forum: Python
Topic: pi3d font definitions killing background
Replies: 2
Views: 353

Re: pi3d font definitions killing background

64 seems to be the most capricious GPU setting as sometimes it works and sometimes it doesn't. Changing a host of things can stop rendering - there should be a logger message now (as of v2.19) I haven't had an issue with 128
by paddyg
Sat May 06, 2017 9:42 am
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

Re: pi3d - Sprites laying over textblock????

@AshPowers, thanks for struggling on with various pi3d quirks; I will add them to the FAQ for the sake of others. The lack of GPU memory symptoms are so varied they're quite hard to figure out, especially if you're just getting to grips with a new ...
by AshPowers
Fri May 05, 2017 6:35 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 576

pi3d - Sprites laying over textblock????

pi3d.textblock is being "overdrawn" by pi3d.imagesprite text is actually on the screen, behind the "background" sprite that takes up the entire display area. Other sprites are showing up along with the background sprite. When ...
by AshPowers
Fri May 05, 2017 6:18 pm
Forum: Python
Topic: pi3d font definitions killing background
Replies: 2
Views: 353

Re: pi3d font definitions killing background

Problem was memory allocation. The default of 64MB for the GPU was not enough. I thought I had already bumped it up!

Menu-Rasbberry pi configuration - performance - GPU memory: set to 256
by AshPowers
Tue May 02, 2017 3:22 am
Forum: Python
Topic: pi3d font definitions killing background
Replies: 2
Views: 353

pi3d font definitions killing background

... need to be in white. There is a background image of a gauge cluster which has moving needles, digital values, etc. When I make a call to a second pi3d.Font definition for a white color text, the background image no longer appears. Program runs just fine, but all you see are a bunch of analog needles ...

Go to advanced search