Go to advanced search

by jmacey
Tue Aug 28, 2012 3:26 pm
Forum: OpenGLES
Topic: Gimbal lock, despite using Matrices and Quaternions
Replies: 15
Views: 4406

Re: Gimbal lock, despite using Matrices and Quaternions

I've just uploaded an non graphical demo of a simple matrix class here http://nccastaff.bournemouth.ac.uk/jmacey/MatrixRotation.tgz If you extract the file using tar vfxz MatrixRotation.tgz cd MatrixRotation make It will build a simple demo, this uses a cut down version of my Mat4 matrix class to pe...
by jmacey
Tue Aug 28, 2012 1:52 pm
Forum: OpenGLES
Topic: Gimbal lock, despite using Matrices and Quaternions
Replies: 15
Views: 4406

Re: Gimbal lock, despite using Matrices and Quaternions

If you get a chance have a look at my lecture notes here http://nccastaff.bournemouth.ac.uk/jmacey/ASD/slides/Lecture9VirtualCamera.pdf This introduces the concept of a Virtual Camera as well as a transformation stack. This is done for Desktop Core Profile OpenGL using a shader to do the final verte...
by jmacey
Tue Aug 28, 2012 8:00 am
Forum: OpenGLES
Topic: Gimbal lock, despite using Matrices and Quaternions
Replies: 15
Views: 4406

Re: Gimbal lock, despite using Matrices and Quaternions

Just about to head to work but will have a look later, a video would be good. The code below shows how I do transformations using just matrices, the m_scale, m_rotation and m_translation are just 3tuple values holding the x,y,z rotation (degrees) scale and translations for each. It's more about the ...
by jmacey
Tue Aug 28, 2012 7:45 am
Forum: OpenGLES
Topic: Gimbal lock, despite using Matrices and Quaternions
Replies: 15
Views: 4406

Re: Gimbal lock, despite using Matrices and Quaternions

Without seeing the maths in your Matrix and Quat code it is difficult to see what is going on, however a couple of things to check 1. In this code rollVector.x = transformedMatrix[2]; rollVector.y = transformedMatrix[6]; rollVector.z = transformedMatrix[10]; It appears that you are getting the curre...
by jmacey
Sat Aug 25, 2012 5:24 pm
Forum: Teaching and learning resources
Topic: OpenGL ES2 and the RaspberryPi
Replies: 3
Views: 2786

Re: OpenGL ES2 and the RaspberryPi

If you just want to Graphics etc in an easy manner I would look at the QtonPi project as this will allow you to do similar things but is free

http://qt-project.org/wiki/Qt-RaspberryPi

Jon
by jmacey
Tue Aug 21, 2012 6:39 pm
Forum: HATs and other add-ons
Topic: soldering irons suitable for Gertboard?
Replies: 23
Views: 7929

Re: soldering irons suitable for Gertboard?

I use one of these from Maplins http://www.maplin.co.uk/50w-solder-station-35016 every so often they put them on offer think mine was £14.99 when I got it and it works fine for most PCB / Electronic stuff.
by jmacey
Mon Aug 13, 2012 5:06 pm
Forum: General programming discussion
Topic: Help once I've mastered Scratch...
Replies: 5
Views: 1274

Re: Help once I've mastered Scratch...

I also agree with doing things you do in scratch in other languages, python or C are good ones to start with. Python being the simplest as you can just type into the console. Have you played with the examples of programming in the MagPi ( http://themagpi.com/ ) the programming tutorials are really g...
by jmacey
Mon Aug 13, 2012 12:05 pm
Forum: OpenGLES
Topic: Jpeg pictures
Replies: 6
Views: 2720

Re: Jpeg pictures

btw if you pm me your email I can send the code (don't want to put it publicly as it forms part of an assignment I give to my students)

Jon
by jmacey
Mon Aug 13, 2012 12:04 pm
Forum: OpenGLES
Topic: Jpeg pictures
Replies: 6
Views: 2720

Re: Jpeg pictures

I think a combination of SDL blit (http://www.libsdl.org/docs/html/sdlblitsurface.html) and SDL image library http://www.libsdl.org/projects/SDL_image/ would give you a simpler way of quickly doing a proof of concept. It would not be hardware accelerated but should be a good way to do simple tests. ...
by jmacey
Mon Aug 13, 2012 8:37 am
Forum: OpenGLES
Topic: Jpeg pictures
Replies: 6
Views: 2720

Re: Jpeg pictures

The easiest way is to load the image (I use ImageMagick for this) and then set it as an OpenGL texture and render to a quad (if using GLES 2.0 this will have to be a quad made of triangles). The basic process is as follows 1) load image and access pixel data, pack this into a buffer ( unsigned char)...
by jmacey
Mon Aug 13, 2012 8:28 am
Forum: OpenGLES
Topic: Writing graphics shaders design questions
Replies: 3
Views: 1868

Re: Writing graphics shaders design questions

1) there are limitations to the shader size but this is platform dependent and I'm unsure of the size for the pi. On a more practical note, a "multi mode" shader sounds like you will have one uber shader which will do many things, usually this implies an if statement in the shader which are best avo...
by jmacey
Wed Aug 08, 2012 9:35 am
Forum: Raspbian
Topic: Can't shutdown
Replies: 9
Views: 2327

Re: Can't shutdown

getting the same thing here, I'm trying to build one for kids and would really like this to work, anyone got any suggestions? At present I've written two scripts on the desktop to reboot and shutdown so they only have to click them. But would be good to get the actual buttons working
by jmacey
Tue Aug 07, 2012 11:06 am
Forum: Python
Topic: Data Structure Class
Replies: 18
Views: 2678

Re: Data Structure Class

Have you considered using a global dictionary? http://docs.python.org/tutorial/datastructures.html#dictionaries For example #!/bin/python #create an empty dictionary globals={} # each time you do this is will add a dictionary entry globals["url"]='www.google.co.uk' globals["numusers"]=22 # best way ...
by jmacey
Tue Aug 07, 2012 11:02 am
Forum: Python
Topic: Data Structure Class
Replies: 18
Views: 2678

Re: Data Structure Class

This is also an essential read for python classes http://docs.python.org/tutorial/classes.html
by jmacey
Tue Aug 07, 2012 10:58 am
Forum: Python
Topic: Data Structure Class
Replies: 18
Views: 2678

Re: Data Structure Class

In python all the attributes are effectively public so you can access them in the following way #!/bin/python class Colour: # ctor to assign values def __init__(self, _r=0, _g=0, _b=0,_a=1): self.m_r=float(_r) self.m_g=float(_g) self.m_b=float(_b) self.m_a=float(_a) # debug print function to print v...
by jmacey
Tue Aug 07, 2012 10:03 am
Forum: Python
Topic: Data Structure Class
Replies: 18
Views: 2678

Re: Data Structure Class

you most likely need to use a Singleton pattern to allow only one instance of the object with your data. You then access it the way you show in your code. Have a look at this

http://www.python.org/workshops/1997-10 ... vikko.html and http://en.wikipedia.org/wiki/Singleton_pattern

Jon
by jmacey
Mon Aug 06, 2012 7:47 pm
Forum: OpenGLES
Topic: Getting started
Replies: 6
Views: 2045

Re: Getting started

I wrapped a lot of this code up into a C++ class to make it easier, you can see my design and explanation here http://jonmacey.blogspot.co.uk/2012/06/eglwindow-class.html and http://jonmacey.blogspot.co.uk/2012/06/opengl-es-on-raspberry-pi-pt-eglconfig.html Once you have the basic window, most OpenG...
by jmacey
Sat Aug 04, 2012 8:07 am
Forum: OpenGLES
Topic: Getting Started with EGL / OpenGL ES
Replies: 13
Views: 17030

Re: Getting Started with EGL / OpenGL ES

The full source code can be found here http://nccastaff.bournemouth.ac.uk/jmac ... GLDemo.tgz also have a look at this for a lot more OpenGL / PI stuff

http://code.google.com/p/pingl/

Jon
by jmacey
Mon Jul 23, 2012 9:42 am
Forum: OpenGLES
Topic: Need a volunteer to peer review some code
Replies: 4
Views: 1448

Re: Need a volunteer to peer review some code

I'm happy to help, either post it here PM / mail me and I will have a look.

Jon
by jmacey
Fri Jul 20, 2012 7:41 am
Forum: OpenGLES
Topic: SDL and OpenGL ES
Replies: 7
Views: 14407

Re: SDL and OpenGL ES

Here is the minimal code I use to create an SDL context for mouse and keyboard #include <iostream> #include <cstdlib> #include "bcm_host.h" #include <SDL/SDL.h> void exitfunc() { delete win; SDL_Quit(); bcm_host_deinit(); } int main() { bcm_host_init(); atexit(exitfunc); if ( SDL_Init(SDL_INIT_VIDEO...
by jmacey
Wed Jul 18, 2012 4:29 pm
Forum: Staffroom, classroom and projects
Topic: Teaching Youngsters Programming
Replies: 131
Views: 33576

Re: Teaching Youngsters Programming

BTW this is a really good video about using it for teaching kids http://blip.tv/pycon-us-videos-2009-201 ... le-1957160
by jmacey
Wed Jul 18, 2012 4:26 pm
Forum: Staffroom, classroom and projects
Topic: Teaching Youngsters Programming
Replies: 131
Views: 33576

Re: Teaching Youngsters Programming

Wow that was quick work, looks good.
by jmacey
Wed Jul 18, 2012 10:13 am
Forum: OpenGLES
Topic: SDL and OpenGL ES
Replies: 7
Views: 14407

Re: SDL and OpenGL ES

Yes that's exactly what I'm doing as well, use SDL for keyboard and mouse and use my own EGLWindow class for the GL context. I've written a blog post about it here http://jonmacey.blogspot.co.uk/2012/06/opengl-es-on-raspberry-pi-pt-eglconfig.html you can also see some demos that use my NGL library h...
by jmacey
Wed Jul 18, 2012 9:55 am
Forum: Troubleshooting
Topic: Problem: USB Videograbber doesn't show up
Replies: 20
Views: 13470

Re: Problem: USB Videograbber doesn't show up

It could be a power issue, Try plugging it into a powered usb hub as the pi usb ports only have limited power.

For example the kinect is not found unless it is plugged into a powered usb hub (not that I can get the video actually working as yet but that's a different story)
by jmacey
Wed Jul 18, 2012 9:51 am
Forum: Staffroom, classroom and projects
Topic: Teaching Youngsters Programming
Replies: 131
Views: 33576

Re: Teaching Youngsters Programming

For kids the python turtle module is great.

http://docs.python.org/library/turtle.html

It's pre-installed by default and you can start doing basic drawing with a few commands

Code: Select all

import turtle

for i in range(0,5) :
   turtle.forward(25)
   turtle.left(45)

Go to advanced search