Pergunta

I'm creating a dice game for the iPhone. I'm using SIO2 as engine, but I think this question is more general OpenGL-related.

Since the iPhone lacks support for anti-aliasing, my dice looks kind of edgy. If possible, I'd like to make the edges of the die rounded and smooth instead of sharp. I've found one app, MotionX, that manages to do this, and I think without using anti-aliasing. See screenshot here. If you look closely at the dice edges, you see there is a floating transition from the brightly lit top face to the shadowed side face. This looks kind of round from far away.

Does anyone know how to recreate such an effect?

Foi útil?

Solução

If you look closely at the dice edges, you see there is a floating transition from the brightly lit top face to the shadowed side face

Not sure if the iPhone supports this, but you may be able to achieve this effect with a normal map:

http://en.wikipedia.org/wiki/Normal_mapping

Of course, you'll need to truncate the corners to get them sufficiently round enough that the normal map will get you the rest of the way.

Outras dicas

You need to create the dice with slightly rounded edges and corners. That way there won't be a sharp transition between each face.

If your modelling package can create them you could use Superquadrics to create this sort of model. You can change the parameters of the equation to produce the effect.

See the top left figure on this image

alt text
(source: free-online.co.uk)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top