I’ve worked on computer graphics for over twenty years now. Through some quirk of fate, I have spent nearly all of my time programming batch rendering algorithms that take minutes or even hours (days?) to render pictures. The last time I really did interactive work was before OpenGL even had the “Open” prefix, back when I was working in the Princeton Applied Math department back in 1990. So, I’m not exactly the most experienced OpenGL programmer. I haven’t written anything more complicated than simple 2D plotting in years.
So, I was working on my program that reads the accelerometers from the Wii Remote tonight, and tried to set it up to draw an airplane that I could tip and tilt using the Wii remote. Unfortunately, I couldn’t get the lighting to look right. I tried all sorts of different things, but finally decided to do a bit of research and found this page:
Avoiding 16 Common OpenGL Pitfalls
What bit me? Why, the very first thing: glEnable(GL_NORMALIZE);
. It never dawned on me that OpenGL might fail to compensate for scaling before computing lighting. Oh well. Live and learn.
I’ll have some example code and video of this little hack this weekend. I want to clean it up a bit more, and I still need to shoot some video of it.
An interesting aside bit of personal trivia: the model that I am using is a model of the NASA’s X29 experimental aircraft. It’s the same polygonal model that I first rendered with my old raytracer over twenty years ago. I feel like I’ve come full circle.
[tags]Computer Graphics,Wii Hacking,Wii Remote[/tags]
Addendum: Here’s a brief blurb about the X29 from NASA.
Addendum2: Here’s a screen dump of the same shaded in OpenGL:
Recently read an article in Linux Journal, written by Nicholas Petreley, states that M$ owns the rights to the openGL software patent. If this is true, does your company(Dreamworks) have an undisclosed balance sheet liability? If you’re interested, I can refer you to the article.
Wow. How odd.
In no particular order:
Did this answer your question?
Mark:
Yes, this answers my question.
Sorry, I didn’t mean to come across as a FUD replicator or troll. I used to be a fairly regular listener of your now wayward podcast. Just wanted a bit of education regarding this talk about OpenGL being patent encumbered. It would be a shame if M$ greed could somehow cripple Beryl and Compiz projects.
BTW: I often confuse Dreamworks and Disney, don’t ask why 😉
hello can it possible that you give me the code how to draw a aircraft in opengl because i want to make a project on which i want to use it but i shall mension your name in it.
thank you
Sir,
Can u please mail me the OpenGL program for Stars program with turbo and crazy mode.
I am in need of its synopsis with one page of description.
If u can send me I will be grateful to u .
Can anybody please help me write a synopsis for the bounicing ball program?
Can anybody please help me write a synopsis for the bouncing ball program?
is it possible give me the code how to draw an aircraft in opengl for my project,it is necesery
thanks alot