Feb 08

I added a new module to the SP Game Framework:

A profiling system capable of multiple threads and hierarchical structures. The profiling results can be watched in realtime on screen. Here is a screenshot of my actual proof of concept for solar tactica:

2011-02/hprof_threads.png

To profile your application you can add macro code which will generate a scoped variable. Time is measured from construction of this variable until the destruction. You can easily measure chunks of code with scoping brackets {}.

If your application is ready to be realeased, just define SP_RELEASE_VERSION and the macro code will not end up in your application. No performance impact!

Have fun.

Jun 11

This is the goal:

Have a big amount of spaceship flying around the player
and avoid collision with the player, flying projectiles and
other spaceships.
They should fly in a natural way and should not be scripted.

The solution:

May 02

I already showed some pictures and information about this project.

Post No 1

Post No 2

Post No 3

This article will finish the series and will give more details about the past work.

The basic idea was to get 3D Information with the use of a line laser which is reflected by objects. This line can be used to calculate how far away something is.

This is only possible when I know the following: relative position of camera and laser, opening angles of the camera, resolution of images.

The reflected light of objects comes from the laser and goes into the camera. Therefor we need to calculate where a virtual ray from the camera intersects with the laserlight. To simplify calculations the laserlight is interpreted as an infinite plane in space. Since the laser is only visible when its light is passing the frustrum of the camera this is no problem. The ray from the camera is calculated Pixel by Pixel. Each lit pixel is converted to a point in realworld coordinates with the help of the opening angles.

To get the realworld 3D Point, we need to calculate the intersection of the ray with a plane. Thats all.

2010-03/laserstuff.jpg

How to get the image of the laserline?

You need two images to get the laserline. Switch off laser, capture an image, switch on laser, take another image. The difference between images should only be the laserline.

2010-03/laserdetection.jpg

Optimizations:

To reduce the noise, a median filtering was used. To get only Pixels of a line, a ringfilter was used.
Interpolation was done only when to pixels where close to each other. Otherwise edges would be destroyed.

Apr 10

Bought a better webcam. Improving the program a bit. I get nice data from this method now and also added some colors to identify objects. Still working on some small errors. :-)

 

2010-04/clipboard02.jpg

Mar 24

After calculating the line-data from the delta-image of the webcam, I figured out how to get to 3D-Coordinates from all data that is given:

  • I know the position of the Line-Laser
  • I know the rotation of the Laser
  • I know the opening angles of the camera
  • I know the lit pixels on screen

I made the model a bit simpler by assuming that the line-laser is absolutely vertical and is represented by a plane in space. The lit pixel from my screen is representing a ray through space. That ray can be calculated, if you know the opening angles of the camera.

The Intersection between the ray (from pixeldata) and the plane of the line-laser is a 3d-point in the real world where an object is actually scanned.

2010-03/laserstuff.jpg

I used Java3D to represent the points in space. I will test it with a real laser and some motors to control the laser tomorrow. Here is an actual screenshot:

2010-03/clipboard03.jpg

Stay tuned :-)

Mar 16

My goal is to calculate the distance of objects with a line laser.

This is the first step: Making a reference picture with a webcam and try to find the laser on a second picture.

2010-03/laserdetection.jpg

It's really easy. The most work was to get the cam and Image handling to work with java, since my webcam does not support Quicktime. I used JMF for that task.

stay tuned.

Feb 26

Screen handling and drawing simple lines and boxes is now working on the psp.

Next big step will be textures. If they work, the rest should be easy to get running. My goal is to get the framework wich is running on Windows, Linux and Mac also to run on the PSP without modifying the code. It works on Windows and PSP without changing the code, as the photo shows. :-)

Stay tuned, get the RSS Feed ;-)

Feb 15

I made a simple Hello World example with our SP-Framework to demonstrate the text rendering and to give some hints about the structure of the framework. I will add more description and an overview of the framework later.

  • 1