Random Etc. Notes to self. Work, play, and the rest.

Posts Tagged ‘3D’

3D Picking

Back to our regular scheduled programming.

I've just been experimenting with a couple of implementations of 3D picking for simple scenes composed of triangles.

Picking with buffer is really simple, and can be pixel-accurate (but isn't in this case because I reduced the picking resolution for speed reasons). It requires you to draw your scene twice... once as you normally would, and once to an offscreen buffer using the triangle index as the fill colour. You then look at the colour of the object under mouseX/Y in the buffer to get the index of the picked object. It's a bit slow, but it works accurately even in this random-triangle scene.

Picking with projection projects all the triangles to screen space, depth sorts them, and checks if any of the projected triangles contains the mouse point. It's not 100% accurate, but for scenes without intersecting triangles it will be fine, and it's faster than the buffer-based method.

There are much faster methods if you're dealing with more geometry, but either of these methods should be fine for simple scenes. On the Processing board, cello points out this great tutorial for doing the same things in OpenGL. Marquee selection would be a simple extension of the pixel buffer method, and a ray-based tutorial is in the works (stay tuned).

It's worth noting that the back-buffer method documented there works for P3D (so no need to create another graphics object) but that in OpenGL the get(mouseX,mouseY) method doesn't work in the same way yet, so it requires different code (example here).

Apologies for delay with raycasting example. If anyone else wants to do it, please feel free and I'll link to it from here. Otherwise, don't hold your breath!

21st century fridge magnets?

Ortho Type is a 3d font concept from Enrico Bravi, Mikkel Crone Koser and Paolo Palma, with virtual and physical implementations. The demonstration applet allows you to write your own messages, and the interface allows you to read the message from different angles. It has to be seen moving, I think, in order to appreciate just how smart it is. I would definitely buy a box full of these - I want to pick them up and move them around!

A Brief History Of Me

For any readers who don't know me, here is a brief overview of some of the things I have been involved with recently.

Non-realistic Rendering In Immersive Environments

A non-photorealistic rendering of an Indian temple
Is there an 'uncanny valley' for rendering quality? For our EngD group project, Sheep Dalton (Ovinity), Monica Martini (Martini Architects), Sean Varney (Soho Cyberscan / Framestore CFC) and I built a model of an Indian Temple and a non-photorealistic OpenGL rendering engine for use in desktop and immersive VR systems.

Social Network Visualisation

A visualisation of an alumni network
A social network visualisation for the students, alumni and staff who have been involved with the MSc Virtual Environments in the Bartlett (UCL's architecture school).

Algorithmic Art

Algorithmic Art, using the Processing environment
A series of pixel-exposure techniques using the Processing environment.

Virtual Trees

Whipping Trees, a VRML Project
Whipping trees, a VRML world and a study in dynamic growth, responsive form and emergent spaces. Completed as part of Methods of Synthetic Construction 1. You can view all our VRML coursework on the course website. This work was significant for me because it involved taking what were effectively several small sketches (pieces of code) and combining them into a single piece of work, with a narrative and a sense of cohesion.

2D Robot Simulation

Bio-Inspired Evolutionary Agent Simulation Toolkit
At Leeds University, I started the development of a Bio-inspired Evolutionary Agent Simulation Toolkit, a project initiated by Seth Bullock and ably continued by David Gordon (now of Framestore CFC). Whilst I was there, I also took part in a Bio-inspired Computing reading group, worked on an interface for playing poker against evolved neural-network players, and investigated the possibility of doing image processing with artificial life.

Extrusions

Ordered Chaos

Motion Capture

Menger Sponge