Articles 3D Audio Custom Controls General RB Graphics Hacks Mac OS X Menus Novelty Printing REALbasic 2005 REALbasic 2006 Registration Resources Reviews Serial Speech Sockets XML Video Resource Links News Current News February 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 ![]() REALbasic for Dummies by Erick Tejkowski ![]() Learning REALbasic through Applications REALbasic for Macintosh REALbasic Cross-Platform Application Development
Older files are in Stuffit 5 or greater format. Newer files are ".Zip". Download StuffIt Expander |
|
Good Morning, Class
Getting a little fancier now. It rotates a textured square.
The GLTexture Class tex = New GLTexture(PicTexture, GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR)
Later if we had more objects in our world we could create a whole class structure and have each class either derrive from a common base or implement a common GLObject3D interface and fill an array full of them. Then to render each frame, the OpenGLView would just run through the array and call the Render method of each of the items causing them to draw. Of course we're not there yet, so let's not think about that. Here's the new SquareObject Render method. Note that the SquareObject class has two new properties, tex as GLTexture (which is created in the SquareObject constructor using the line of code above) and Rotation as Double.
As you can see, this code also handles input by reading the keyboard for the left arrow and right arrow being pressed down. This is a simple demonstration of how you can read the keyboard for the state of keys. The value passed to AsyncKeyDown is a KeyCode, not an ASCII value. KeyCode values can be found in the User Guide on page 319 in the version I have. Your page may vary.
Finished
|
||||
|
||||||||||||||||||||||||||||||||
Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.
[an error occurred while processing this directive]