Wednesday, December 9, 2009

Eclipse C / OpenGL tips

Importing existing C Makefile projects
Create New Project > C Project > Makefile project

To Debug using eclipse add to CFLAGS in Makefile
-g -O0

OpenGL and Eclipse Debug(gdb?) works
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-cpp-galileo-SR1-linux-gtk.tar.gz&url=http://download.eclipse.org/technology/epp/downloads/release/galileo/SR1/eclipse-cpp-galileo-SR1-linux-gtk.tar.gz&mirror_id=1

OpenGL Superbible (3edn) and code
http://proquest.safaribooksonline.com/0672326019/ch01?reader=html#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTA2NzIzMjYwMTkvY2gxNWxldjJzZWMxMiZpbWFnZXBhZ2U9

Wednesday, October 21, 2009

Blender Aim the Cam

To make one or more objects track another object (the target) select at least two objects and press CtrlT. The active object becomes the target and the others objects the trackers. The (Make Track Menu) provides several options for creating the initial tracking:

http://wiki.blender.org/index.php/Doc:Manual/Modelling/Objects/Tracking

Tuesday, October 6, 2009

Read vertex cordinates in Blender3D

Blender can be used to read the coordinates of a desired vertex off a 3D model (Ex: 3ds)

1) Zoom in to the desired area (scroll button = zoom, middle drag = rotate, shift+middle = pan)
2) 'Tab' to enter 'edit' mode
3) Right click desired vertex
4) 'n' to see vertex coordinates

Sunday, September 6, 2009

3D to 2D Rendering, OpenGL and MATLAB

Short notes on OpenGL rendering and attempted integration with MATLAB.

Vertex Buffer Objects (VBO)

  • Allows you to give vertex, vertexnoms, face array locations directly for openGL to render (as opposed to drawing triangles one by one)
Frame Buffer Objects (FBO)
  • Allows you to draw to a buffer/texture (without directly to the screen)
Ref: http://hacksoflife.blogspot.com/2006/10/vbos-pbos-and-fbos.html

MEX and OpenGL
  • Use mex -v -lGL -lglut -lGLU cfile.c
  • Problems with glutinit() when calling mex file (MATLAB crashes when mex file is caleld again - cant do repeated rendering/calculations)
  • Probably not possible?
  • http://www.mathworks.com/matlabcentral/newsreader/view_thread/166039
  • http://mathforum.org/kb/message.jspa?messageID=6145127&tstart=15

Thursday, August 27, 2009

Multi hop ssh tunnelling

localhost ----linkA----> gatewayhost ----linkB-----> remotehost

localport <========ssh============>remoteport

Requirement
:
  1. Need to access remote service in remotehost (on remoteport) from localport in localhost (this quite be a database service to anhttp proxy service -- not much difference here)
  2. Both links A and B allow only SSH traffic (other ports are blocked)

Solution 1:

A simple

$ ssh -L localport:remotehost:remortport -N -f remoteuser@remotehost

would create an ssh tunnel on link A but not on link B . As both links allow only ssh traffic this will not work.

One solution is to use the ssh proxycommand option like this:

$ ssh -oproxycommand="ssh -qaxT gwuser@gatewayhost nc %h %p" -L 3128:localhost:9998 -p9999 remoteuser@remotehost -N -f


Monday, August 17, 2009

Publickey (no password) ssh/scp in Ubuntu (9.04 and maybe other)

As per launchpad

https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/201786

There is a bug that prevents public key ssh/scp from working when configured according to 'man ssh'. (Due to the way ssh-agent / seahorse is setup )

The trick is to run 'ssh-add' after the normal procedure as per 'man ssh'.

So the entire procedure would be something like this.
  1. Generate keys on the local machine ($ ssh-keygen -t rsa -b 4096 #press enter twice, I'm using 4096 instead of the usual 2048 bit key)
  2. Copy the public key using ssh-copy ($ ssh-copy-id -i ~/.ssh/id_rsa.pub remoteuser@remotehost #assuming keys are in the standard location)
  3. Now make sure we run ssh-add ($ ssh-add )
That should do the trick!

Friday, July 17, 2009

Skype on Ubuntu 9.04 with mic and headset problems

This was tested on Ubuntu 9.04 running on a Dell OptiPlex 960.

A simple handset was used with the mic and earphone jacks connected to the sockets in the front (above the USB slots).


A picture speaks a thousand words.. so its all in the screenshots.

Step 1: Change volumes settings as follows.






Step 2: Change skype options as follows




This might also help:
http://funwithlinux.wordpress.com/2009/04/20/fixing-skype-audio-problem-on-ubuntu-904/#comment-50