Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

pi3d: how to organize?

Thu Nov 15, 2012 7:04 pm

Until someone complains, I think we can just hijack a little space this Python board and preface our postings with pi3d:, giving subjects like:

pi3d: how to organize
pi3d: trouble installing
pi3d: new functionality

So far we have quite a few potential contributors to the code base, and we've been proceeding informally, just letting people check in, and IMHO I don't see any reason why this should change.

However, I'm contemplating github's "pull requests".

I'm a bit of a dunce on using git and github, which is shameful because I use it so much... :-) I get the impression, however, that pull requests give you a way to do something like code reviews?

Should we be using pull requests in cases where someone wants to show potential code, either in the pi3d framework or their own code, to the group for discussion?

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Thu Nov 15, 2012 9:05 pm

Tom, I for one, will take my lead from you! As per my comment on the last thread I tend to muddle through with github. I'm not really sure about pull requests where there's joint admin. I will have a read up on it.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Thu Nov 15, 2012 9:08 pm

I think the best way to learn this is to actually do one, even if we mess up the first couple.

I'll look for an opportunity to do one or perhaps we can convince someone in the other thread to do it.

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Thu Nov 15, 2012 10:50 pm

Tom, reading the documentation it sounds like rec/pi3d/ is more set up for topic branches https://github.com/dchelimsky/rspec/wiki/Topic-Branches. Maybe I should make a branch for my ElevationMap fiddling (yes I have made more changes on my version), you could make a branch for the background thread loading. I will read a bit more to make sure I fully understand it!
this is good too http://git-scm.com/book/en/Git-Branchin ... nd-Merging
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Fri Nov 16, 2012 5:57 pm

Tom (and anyone else) I have just made a branch and committed it and pushed it back. And amazingly it has appeared on github. The steps I took were (documenting them here for my own reference as much as anyone else)

cd rec/pi3d
git pull origin master
git checkout -b clash_007

git checkout master
git checkout clash_007
(these two steps not need but it's how to swap from branch to master and back if needed)
I then did some editing (used the clouds for the ground, quite interesting) then
git add demos/Pong.py pi3d/shape/ElevationMap.py
git commit -m 'trying a commit to this branch!'
git push origin clash_007

I think that another collaborator can test and work on this branch by
git pull origin clash_007
but I don't know whether you've got to create a branch locally with that name first and git checkout to it. Let me know what happens. I might keep this as a branch for a while as there are still occasional glitches with clashTest and I realise that these methods really should include the x,y,z values of the elevationMap and the rotate and scale methods probably should be disabled.
Eventually I will have to work out how to merge it back in!
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Fri Nov 16, 2012 6:04 pm

Oh, interesting! I have a show tonight, but I'll be checking it out over the weekend.

Regarding branches and such - a "pull request" is as far as I can see completely independent of whether you're developing on a branch or not.

https://help.github.com/articles/using-pull-requests

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Fri Nov 16, 2012 9:00 pm

I'm not too sure about the details! Reading through that it starts out by mentioning topic branches for collaboration but most of the article seems to be relevant to fork and pull setups. I have just tried pressing the pull request button on github and it seems to be sending a request from rec/pi3d, branch clash_007 to tipam/pi3d, branch master. I will hold off doing that until I know that Tim is definitely back in the saddle and can cope with sorting it all out.

I wouldn't be surprised if just doing the git pull origin clash_007 sorted the process out on collaborators' computers. I'm increasingly impressed by git. If I git checkout between master and clash_007 all the files magically change when I then open them with geany! I'm sure it will prove to be very clever when I come to merge the branch back in.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Sun Nov 18, 2012 8:57 pm

To keep a record of what to do with git in future: I have brought my branch up to date with the latest mods pulled from github. So
earlier
git checkout master
git pull origin master
...
some more changes on my branch then
git checkout clash_007
git add ...various files that need committing
git commit -m 'bring branch up to date'
git rebase master

I will do the merging back in a day or two but I understand it is just a matter of committing all the changes in the branch then
git checkout master
git pull
git merge clash_007
then probably delete the branch
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Mon Nov 19, 2012 1:18 am

I think you're on the right tack - let us know!

I have gotten into trouble with branches in git in the past, but usually I can resolve it "by hand" in the worst case...

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Mon Nov 19, 2012 8:24 pm

Update possibly useful info. I though it might be nice to have simple monsters based on other standard shapes (than sphere) and when I looked at them I realised that there were all kinds of things wrong, mainly with normals, so I fixed them. But I was in the clash_007 branch. When I came to push them back up I had to pull changes in order to 'fast-forward' i.e.
git checkout clash_007
git add ..files..
git commit -m '..'
git pull origin clash_007
git push origin clash_007

I don't really know why, probably due to me previously rebasing
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Tue Nov 20, 2012 2:21 am

Noted!

I'll be back on this tomorrow...

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Tue Nov 20, 2012 9:32 am

Final branch experimentation. This is what I did to get the work on the branch back into the master:
git checkout clash_007
..mods and testing the files..
git add ..files that had been worked on..
git commit -m '..etc..'
git push origin clash_007
git checkout master
git pull origin master [it was up to date so not needed but might be sensible in case]
git merge clash_007
git branch --merged [just to check that this branch has been merged]
git push origin master
git branch -d clash_007 [delete it]

The clash_007 branch still shows on github but is now the same as master.

Using branches might be worthwhile where there are more fundamental changes i.e. the (eventual) switch to opengles2.0 or the background thread texture and model loading. i.e. where it might take a while and go horribly wrong.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Tue Nov 20, 2012 6:34 pm

My tendency is to use branches locally to "fool around" but to at least attempt to bring everything back into the main branch before checking in - partly because of having had issues in other projects with too many branches.

Oh, and we should be tagging code at least when we know it's good!

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Thu Nov 29, 2012 3:46 pm

Hi pi3d people. I've just pushed the first snapshot of the conversion of the github.com/rec/pi3d to OpenGL ES 2.0. I'm putting on branch gles2 (drop down selector on the left).

I haven't worked my way through all the shapes yet but most of the lathe based ones work (Cylinder, Cone, Torus, Lathe, Sphere, Tube etc) plus Cuboid, Plane and Disk. I will get the others out soon plus sprites and some more instructions.

There is a very basic demo called Pi3d2.py (rather unimaginatively.)

You will be able to see the main differences but basically:

There is a Display and Textures (as before)
then a Light and a Camera are added to a Scene
the Scene is subsequently used in combination with a list of Textures in the creation of various Shader objects that are used with the draw() method for the various object.

The first texture is the basic colouring, the second is used as a normal map, and the third is a reflection. The two floats at the end of the Shader constructor are the number of times to multiply the UV mapping by for the normal map and what proportion of shine (reflection from map) to use.

The bottom line is that all kinds of things are possible using shaders which run in compiled code on the graphics chip and are much faster than python.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

JamesR
Posts: 78
Joined: Sun Aug 05, 2012 11:21 pm

Re: pi3d: how to organize?

Fri Nov 30, 2012 12:16 am

Look forward to trying it.

User avatar
tipam
Posts: 92
Joined: Fri Dec 30, 2011 1:32 pm
Contact: Website

Re: pi3d: how to organize?

Fri Nov 30, 2012 9:40 am

Pi3D now updated on http://www.github.com/tipam/pi3d with new demos, features and bugfixes. Several new features include;

1. pi3d.tkwin class that embeds the Pi3D display into a TKinter window. Although not perfect, you can now resize, move and capture window events such as keyboard and mouse - keyboard works without buffer lagging!
2. pi3d.logDraw3 function that draws Level Of Detail models (ie. the closer you are the more detailed)
3. pi3d.DrawString2D and pi3d.DrawString3D draws text in both the 3D and 2D contexts
4. Two new demos including TigerTank.py and MarsStation.py use the features above (see below)
5. Also included Paddy Gaunts great Amazing.py demo and Pong.py demos!

Have fun!

Tim

Image
Image
Raspberry Pi == small computer == big dreams

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: pi3d: how to organize?

Fri Nov 30, 2012 6:48 pm

This all looks great and stuff but who's working on what and which version should us mere mortals be using?

After all, kids need a routine ;)
Apple say... Monkey do !!

ghans
Posts: 7854
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: pi3d: how to organize?

Fri Nov 30, 2012 6:58 pm

This looks great.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Fri Nov 30, 2012 7:03 pm

A very good question, which we're discussing offline!

The underlying algorithms for drawing are much the same between branches. The difference is in the API. My theory is that the API in the "rec" branch will be close to the final one, because it deals with some key issues that can't be handled in the original.

sdd
Posts: 64
Joined: Sun Oct 21, 2012 5:48 pm
Location: USA

Re: pi3d: how to organize?

Sat Mar 16, 2013 3:05 pm

Not quite sure where to put suggestions, but could pi3d load .blend files in the near future? PS awsome work so far, keep it up!

Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

Re: pi3d: how to organize?

Sat Mar 16, 2013 5:15 pm

Hello!

These days, probably the pi3d mailing list is the best place to post.

I don't check this forum so much but :-D I'm watching this thread anyway so you'll clearly get my attention at least if you post here.

I'll pass it on!

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Sat Mar 16, 2013 8:38 pm

sdd, thanks for the act of faith that any of us have the capacity to do that! I don't think pi3d will ever approach the capability of blender but it might be able to extract some info such as for a model and use that. It's not too difficult to export from blender to a wavefront obj and pi3d can import that. See http://pi3d.github.com/html/FAQ.html
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

sdd
Posts: 64
Joined: Sun Oct 21, 2012 5:48 pm
Location: USA

Re: pi3d: how to organize?

Sun Mar 17, 2013 4:37 pm

thanks! when you import it to .obj will it keep textures and materials? It doesn't really matter to me all that much, it was just an after thought, what I'm going for right now is just a simple tower defence game.

User avatar
paddyg
Posts: 2307
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Sun Mar 17, 2013 5:16 pm

sdd

yes. If you look at the demos you will see some examples and I mention a few of the things to look out for when exporting from blender on the faq link. Material colour and texture information are used but more complicated rendering information is not (at present). But you can add your own normal maps and reflection images in pi3d.

Blender sound a complicated place to start for a 'simple' tower defence.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: pi3d: how to organize?

Sun Mar 17, 2013 7:27 pm

normal maps and stuff. nice.
note: I may or may not know what I'm talking about...

Return to “Python”