Tuesday, October 6, 2009

About C / C++ / C#: And a Minor adjustment to Challenge 28

About.com    C / C++ / C#
In the Spotlight | More Topics |
  from David Bolton
Challenge 28 proves challenging in getting it right. As one commenter had pointed out, trucks could be given infinite speed so they are now 50 MPH. I updated the challenge during the week so take a look. Challenge 27 had six entries that are now being marked with results later today or Wednesday at the latest. Have a great week!

 
In the Spotlight
Common Pearls of Programming Wisdom
O'Reilly are the publishers of some of my favorite books (and now Microsoft Press following a recent deal) but even more interesting is a Creative Commons open source list of Programming Wisdom tips that they've setup. "97 Things Every Programmer Should Know" is a wiki that anyone can join and edit though unlike Wikipedia you are only expected to edit your own contributions. These should be US spelling between 400 and 500 words in length. There's actually 98 listed at the time of writing. That is quite a bit of reading to get through so don't do it all at once!
           More Topics
An Astounding Demo
Puls ScreenshotI make no apologies for mentioning Puls because I think it's a really impressive bit of programming (in assembly) and it was originally written in C. It uses no 3D libraries or hardware acceleration. Puls is a Binary-search raycasting of an animated 3D scene and is just 256 bytes long. You can watch a demo video of it if you don't want to run a dos cmd line program on your PC. There are also Windows versions but they're normal size exes! Jan Kadlec (aka Řrřola), the developer of Puls has published a lot of useful C code for graphical transformations and even a simple Wolfenstein type game. Back in the 1980s there existed a demo scene where programmers produced scores of highly impressive demos of what they could get a computer to do. It was usually but not always a CBM-64. I never took part in that scene but did manage to get 24 hardware sprites on screen in a game at once (the hardware only supported 8 sprites but you could set an interrupt to occur down the screen on a scan line and reposition them). There is still a demo scene now and most of it is in assembler, hence usually off-topic for here but irrespective of programming language, you can't but be amazed by Puls and it's worth reading a detailed explanation of how Puls works written by Michael Birken whose site you might also enjoy for this ASCII game written in C#.
OpenGL C++ Visualization Library
Developed by Michele Bosi, this is a portable library (Linux, Max OS X and Windows) for creating 2D or 3D graphics using OpenGL. Essentially it's a thin layer on top of OpenGL from C++. This (from the Spinning cube example) gives you an idea of how its used.   void initEvent()   {
    mCubeTransform = new vl::Transform;
    vl::VisualizationLibrary::rendering()->as<vl::Rendering>()->transform()->addChild( mCubeTransform.get() ) ;     vl::ref<vl::Geometry> cube = vlut::makeBox( vl::vec3(0,0,0), 10, 10, 10 ) ;     cube->computeNormals() ;     vl::ref<vl::Effect> effect = new vl::Effect;     effect->shader()->enable(vl::EN_DEPTH_TEST) ;     effect->shader()->setRenderState( new vl::Light(0) ) ;     effect->shader()->enable(vl::EN_LIGHTING) ;
    effect->shader()->gocMaterial()->setDiffuse( vlut::crimson ) ;     // install our scene manager,     vl::ref<vl::SceneManagerActorTree> scene_manager = new vl::SceneManagerActorTree;     vl::VisualizationLibrary::rendering()->as<vl::Rendering>()->sceneManagers()->push_back (scene_manager.get()) ;     scene_manager->tree()->addActor( cube.get(), effect.get(), mCubeTransform.get() ) ;   }


 
 
Sponsored Links
 
Cell Phone Picker
Find the Best Cell Phone for You
Simply answer a few easy questions about size, price and features, and you'll receive a personalized list of the five phones that best match your requirements.

C / C++ / C# Ads
Advertisement
 
 
Visit Related About GuideSites:
Search About   

 
Sign up for more free newsletters on favorite topics.

You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter as jarloszy2.profile@BLOGGER.COM. If you wish to change or remove your email address, please visit:
http://www.about.com/nl/usgs.htm?nl=cplus&e=jarloszy2.profile@BLOGGER.COM

About respects your privacy. Our Privacy Policy.

Our Contact Information.
249 West 17th Street
New York, NY, 10011

© 2008 About, Inc.

No comments: