Pi3D ES 2.0


98 posts   Page 4 of 4   1, 2, 3, 4
by Tom Swirly » Sun Jan 13, 2013 5:26 pm
Regarding "can't run demos from the demo directory".

I have a workaround for the "running demos inside the demo directory" but I don't love it. I filed a bug against myself and I posted a question here to see if there's a better solution

Once I have the best solution for this issue, I'll make the changes in each demo so you can just run or double-click them.
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by Tom Swirly » Sun Jan 13, 2013 5:35 pm
pi3d users obviously do still want to "import everything". I filed a bug against myself for this. Note that the bug also explains why "importing everything" is not a good idea, BUT if people want it, we should let them do it, not give them a lecture! :-D (and it's pretty easy to do).

It's likely that this bug and the previous bug I filed will be fixed by the end of the day...
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by Jim Manley » Sun Jan 13, 2013 8:05 pm
paddyg wrote:Well you can do that with
sudo raspi-config
Is that what you mean? If it's an old version that doesn't have memory splitting (and other options) there's a menu option to try to upgrade itself. After a restart it should be the latest version and allow you to change the memory at will (and overclock it etc) Mine worked fine with 64 until I tried one with big image files for textures (ConferenceHall). Not a permanent fault though, the other demos still worked

raspi-config only updates config.txt with the new RAM split - you still have to reboot for the change to take effect (raspi-config even asks if you want to reboot after the file is updated).

So, I finally got time to try the demos in integration again ... and ran smack into the pi3d.util.Log issue. Of course, I assumed it was still my fault, but it's nice to see, for once, that I'm not the only one with a flat forehead from smacking it so much with my palm. Seems like we might need a "disintegration" branch ... :lol:
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!
User avatar
Posts: 1358
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, USA
by rurwin » Sun Jan 13, 2013 11:08 pm
Thanks Tom; that fixed it. You're not the only one, Jim. I was fairly certain it wasn't me, but not totally.

You have a pull request.
User avatar
Forum Moderator
Forum Moderator
Posts: 2935
Joined: Mon Jan 09, 2012 3:16 pm
by Tom Swirly » Mon Jan 14, 2013 12:09 am
Oh! Let me check this, I *just* checked in a change to the code seconds ago so you might have to merge...
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by Tom Swirly » Mon Jan 14, 2013 12:13 am
Tom Swirly wrote:Regarding "can't run demos from the demo directory".

I have a workaround for the "running demos inside the demo directory"


I checked in a slightly simplified version of the fix I proposed above - you should be able to run any of the demos from any directory now. This fixes https://github.com/tipam/pi3d/issues/49.

Each new demo needs to include two lines like this, which isn't too bad.
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by Tom Swirly » Mon Jan 14, 2013 12:18 am
The event handler code has been brought into the integration branch - before I even had a chance to do the work! :-D

I should add that since I've been having network issues for three weeks (thanks, Time-Warner!) I had to use the rather lame mechanism of making the change on the RP and testing it, then transferring those changes to my Mac (where I can get wireless from next door).

So let me know if I broke anything with my change/merge.

Now - the common directory!
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by paddyg » Mon Jan 14, 2013 9:10 am
Thanks Tom. I can *only* run from the top directory, but that's probably ok so long as you change the working directory in Geany as well. I've updated the ReadMe for github.com/tipam/integration to explain how to set up Geany.
PS sorry about springing the pull of rurwin's mods on you! Thought it was better to get it in and start testing it asap.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d
User avatar
Posts: 1019
Joined: Sat Jan 28, 2012 11:57 am
Location: Bingley, Yorkshire
by Tom Swirly » Mon Jan 14, 2013 4:11 pm
Wait, you still can't run from the subdirectory (in the integration branch)?

What error do you get? I did test my workaround, you should be able to run from anywhere at all.

A technician is here right now, hopefully fixing my internet - I'll be able to get on this properly today.
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by paddyg » Mon Jan 14, 2013 6:05 pm
Traceback... /home/pi/xyz/pi3d/pi3d/Shader.py, line 94, in laodShader
return open(sfile,'r').read()
IOError: [Errno 2] No such file or directory: 'shaders/uv_reflect.vs'


Presumably I could get it to work by changing the path to the shader (and other files), but then it wouldn't work if the demo was moved. Probably not worth spending too much time on, though it would be interesting to know what the difference is between our set-ups
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d
User avatar
Posts: 1019
Joined: Sat Jan 28, 2012 11:57 am
Location: Bingley, Yorkshire
by Tom Swirly » Mon Jan 14, 2013 6:10 pm
Aha. Now I understand, it's that I've been sitting in the root directory while testing the last set of tests.

Well, I can fix this too, shouldn't take me but a few minutes... now my Internet is back up! YES!!!

(I turned my radio station back on too...)
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by Tom Swirly » Mon Jan 14, 2013 7:33 pm
Just pushed a fix - now you should really be able to run any demo from anywhere.
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by paddyg » Mon Jan 14, 2013 8:13 pm
Absolutely brilliant. That's what everyone will expect, and will save loads of questions and confusion!
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d
User avatar
Posts: 1019
Joined: Sat Jan 28, 2012 11:57 am
Location: Bingley, Yorkshire
by Tom Swirly » Mon Jan 14, 2013 8:34 pm
Unfortunately, I can't see a fix to the "can't run demos twice" issue so I closed the bug as "wontfix" with a little explanation. :-(
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by rurwin » Tue Jan 15, 2013 9:09 am
It probably needs everything in the file trapped inside a run() function with a if __name__ == "__main__" that just calls run(). That should delete variables correctly after each run. It may not re-import, but that is probably not a problem.

BTW, I get the Log problem again. Display.py and pi3d/__init__.py are still importing the old one.

I wanna try this: http://www.youtube.com/watch?v=uu7jA8EHi_0
Needs an i7 at 2.8GHz and Windows or MacOS, but source code coming soon. (Probably as soon as they've taken out the cruft and added comments ;-) )
I once saw Jeff Minter at an exhibition showing off his latest application, a sort of interactive sound to light toy using the impressive graphical ability of the Amiga. I told him I would do it on the BBC Micro, and he scoffed. Nevertheless I did just that, in Pascal on the BBC. It was monochrome and it wasn't quite as psychedelic, but it had the same interaction experience... and two user inputs instead of one.
Which means that even if the version that runs on the PC needs an i7, I bet something like it could be produced on the Pi. I'd have to know a whole lot more OGL/ES though.
User avatar
Forum Moderator
Forum Moderator
Posts: 2935
Joined: Mon Jan 09, 2012 3:16 pm
by paddyg » Tue Jan 15, 2013 1:28 pm
You might be able to make something approximating to this by altering the camera view matrix in some suitable Lorentzian way, and adding a final 'blue-shift' shader. Some of the shadertoy examples could probably be altered, some give a distortion along the right lines http://www.youtube.com/watch?v=82PHzktgSNA
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d
User avatar
Posts: 1019
Joined: Sat Jan 28, 2012 11:57 am
Location: Bingley, Yorkshire
by Tom Swirly » Tue Jan 15, 2013 7:12 pm
I fixed the Log issue and pushed the change.

How embarrassing. For the life of me, I couldn't figure out why it would still work - but then I realized that I still had the .pyc (compiled Python) files for the old pi3d.util.Log lying around.

Next time I move things, before I test I'm going to remove all these .pyc files with
Code: Select all
find . -name \*.pyc | xargs rm
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by Jim Manley » Fri Jan 18, 2013 8:21 am
I finally got time to try out the New-and-Improved, Family-sized, Enhanced-Whitening, Minty-Fresh-Flavor integration branch and, YAY!!! It all works just flawlessly. Well, that is if you don't count that some of the demos don't seem to respond to the escape key bail option - some do, and some don't (some even say in the bring-up terminal session that clicking a mouse button will cause it to bail, but it doesn't). If no one else (and not the primary developers, they have bigger fish to fry) has gotten around to it by next week, I'll go through and harmonize the UI in all of the demos to operate identically and will submit recommended changes.

Most notably, I did this on one of my 256 MB Pi boards, and so far, only one demo failed to acquire an EGL_Surface - I thought it was BuckfastAbbey.py, but it has subsequently run successfully. I still have a few more demos to try out, but so far, I'm a very happy camper. This means I can now convert my earlier Pi3D ES 1.1 code to the super-snazzy ES 2.0 form with all of its lights ... cameras ... action! I have an orrery simulation of our solar system running on the old code and it's going to look just fantastic on the 2.0 version. In addition to all of the planets and the larger moons and asteroids in our solar system (with gorgeous NASA-data-based texture-mapped surfaces), it includes an accurate 3-D display of the closest couple of hundred stars in our local group around the periphery. So, you'll be able to virtually wander around our solar system and see views of all of the astronomical bodies just as they would appear if you were on a spaceship flitting about from body to body.

I plan to have both direct-navigation (don't call us, we'll call you, if you smack into a body or manage to fling yourself out of the solar system) and auto-pilot available where you can just dial in your desired destination and the view will smoothly accelerate and decelerate to the specified distance (in standard units or body diameters, etc.). There will be options for always-Sun-facing views, body movement forward/back-looking views (i.e., always looking along the instantaneous movement vector), and probably others (e.g, always-facing-a-specified-body or point in space).

This is all part of the Python version of my Pi-finity! STEM game system, which will be expanded to include physical characteristics data (e.g., 3-D location, mass, and maybe diameter) for as many as possible of the several hundred planets known to be Out There orbiting around nearby stars (many of them binary star systems). There will also be local terrain and structural elements that will be feasible to establish on any of the bodies, and game players will be able to build them up with resources available according to game configuration and current state of play. This will be multi-player, so stand by for extreme fun! Coming soon to a Pi near you in 2013 (hopefully not delayed to a Radio City Music Hall holiday 2013 week extravaganza launch. ):

Great work, guys - "This is all just so fantastic, that is really what I think. Oh, by the way, which one's Pink?" ;)
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!
User avatar
Posts: 1358
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, USA
by rurwin » Fri Jan 18, 2013 9:19 am
Pi-finity sounds great. Sign me up for an early copy. It does minimum energy orbits in real-time, right? We can beat those armchair 747 pilots at their own game. Joking aside, it would be fascinating to see how a gravity slingshot works.

Most of the demos I have tried failed to exit on escape. The reason is that the Mouse and/or Keyboard classes they use use multi-threading, and the threads don't exit. Ctrl-\ gets out, but I dare say you know that. Silo is the only demo at the moment to use the new InputEvents class, which is slicker, doesn't use threads and supports gamepads/joysticks. (If you've got a gamepad, try it out; it's almost as good as the new textures.)

I'm going to be re-imagining the Building class I think. Building is good so far as it goes, but it is inflexible and rather profligate in the number of objects and shapes it generates. Anything more than a very simple and small building would take too long to generate. Using ES 2.0 I think I can put a texture along a wall so it tiles rather than stretches. Silo proves that I need doorways, a wider variety of sizes of wall panels, and the ability to select different textures for individual panels. That requires a more complex configuration process and a more complex class, but it should allow fully customisable rooms and be more efficient. A full 3D model would work, but it's too powerful, difficult to build for a non-artist like me, and getting it to handle solidity would be a non-trivial exercise. Talking of which, another thing I have to handle soon is gravity: jumping, falling and standing on objects.
User avatar
Forum Moderator
Forum Moderator
Posts: 2935
Joined: Mon Jan 09, 2012 3:16 pm
by mickman112 » Mon Jan 21, 2013 11:45 am
Gibble wrote:Just wondering, how feasible would it be to use Pi3D ES 2.0 on a Linux desktop to develop (don't have a separate screen for the Pi, so it hinders me a bit). I'm guessing its mainly the 3D initialisation of display and egl types etc or something which are unique to the Pi, or is there a lot more ? (hmm plus I guess it depends if your gfx card supports 2.0 anyway)

Do any of you code on another platform and then test on the Pi (I know you can ssh remote and get it to display to another screen ok)?


Could you explain how to display the output to another screen? I'm having a hard time displaying the pi3d output to the composite output through ssh..
User avatar
Posts: 6
Joined: Mon Jan 21, 2013 11:43 am
by mickman112 » Mon Jan 21, 2013 12:38 pm
Gibble wrote:Do any of you code on another platform and then test on the Pi (I know you can ssh remote and get it to display to another screen ok)?


Could you explain how to do this? I'm having a hard time executing my pi3d script via terminal to the composite output.
User avatar
Posts: 6
Joined: Mon Jan 21, 2013 11:43 am
by mickman112 » Mon Jan 21, 2013 1:10 pm
mickman112 wrote:
Gibble wrote:Do any of you code on another platform and then test on the Pi (I know you can ssh remote and get it to display to another screen ok)?


Could you explain how to do this? I'm having a hard time executing my pi3d script via terminal to the composite output.


Nevermind, figured it out. In case someone else has this problem.

Important! If you create your Pi3D script in a window, don't. Just take one of the examples that's fullscreen and copy the display settings from there. Then when you're logged in with ssh, type
Code: Select all
python yourscript.py &
that should do it, the & keeps running after you close your ssh session.
User avatar
Posts: 6
Joined: Mon Jan 21, 2013 11:43 am
by rurwin » Tue Feb 19, 2013 5:06 pm
User avatar
Forum Moderator
Forum Moderator
Posts: 2935
Joined: Mon Jan 09, 2012 3:16 pm