<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to examples</title><link>https://sourceforge.net/p/xmantaray2/wiki/examples/</link><description>Recent changes to examples</description><atom:link href="https://sourceforge.net/p/xmantaray2/wiki/examples/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 03 Aug 2013 09:13:34 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/xmantaray2/wiki/examples/feed" rel="self" type="application/rss+xml"/><item><title>examples modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/examples/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v10
+++ v11
@@ -6,7 +6,9 @@
 These can be found in the examples directory, they replace your main.cc file.

 ### 1 Drawing a cube with normal mapping that moves to the right and rotates
+
 &lt;code&gt;
+
 // See main.orig.cc
 {
  double thetax = 1.2;
@@ -55,6 +57,7 @@

 }
 }
+
 &lt;/code&gt;

 ### 2 Drawing a plane grid in a 3D world
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 09:13:34 -0000</pubDate><guid>https://sourceforge.net16aec9cf5d6e7ce333ec23f3465b2906d9598218</guid></item><item><title>examples modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/examples/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v9
+++ v10
@@ -114,14 +114,14 @@
 ### 3 Drawing a grid which rotates

 &lt;code&gt;
-See main.cc in top directory.
+        //See main.cc in top directory.

-ray3d::game::PlaneGrid planegrid(dpyb.get_display(),&amp;amp;w,100,100);
+        ray3d::game::PlaneGrid planegrid(dpyb.get_display(),&amp;amp;w,100,100);
         planegrid.depth_f(0.55,0.55);
         double perspectiveangle = PI/180*90;
         planegrid.perspective(-2,2,perspectiveangle);
         planegrid.map(&amp;amp;dpy,&amp;amp;w,"./pics/texturetest1.xpm",600,375);
-        //planegrid.depthperspective(2);
+        
         double thetax = 0.2;
         double thetay = 0.2;
         double thetaz = 0.2;
@@ -130,7 +130,7 @@
         const char *colorname = "chartreuse";
         XEvent e;

-for (int k = 0; k &lt; 100000; k++) {
+        for (int k = 0; k &lt; 100000; k++) {

         /* blank screen */

@@ -141,9 +141,9 @@
         planegrid.draw(dpyb.get_display(),&amp;amp;w, 100,100);
         planegrid.perspective(-2,2,perspectiveangle);
         planegrid.map(&amp;amp;dpy,&amp;amp;w,"./pics/texturetest1.xpm",600,375);
-        //////planegrid.rotate(engine, thetax, thetay, thetaz);
+        //planegrid.rotate(engine, thetax, thetay, thetaz);

-        //NOTE: draw() is inside eventloop processor
+        
         xmantaray.eventloop(xmantaray,&amp;amp;e);

         /* update movement of world */
@@ -157,13 +157,13 @@
         ts.tv_sec = 0;        /* seconds */
         ts.tv_nsec = 500000000;       /* nanoseconds */

-        //nanosleep(&amp;amp;ts,NULL);
+        nanosleep(&amp;amp;ts,NULL);
         XFlush(dpy);
   }
 }
 &lt;/code&gt;

-### License : GPL version 2
+### License of the code on this page : GPL version 2
 /*
  Copyright (C) Johan Ceuppens 2011-2013

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 08:17:10 -0000</pubDate><guid>https://sourceforge.netb401f7a58c918c52666af4dd75862438809d116b</guid></item><item><title>examples modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/examples/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -113,4 +113,70 @@

 ### 3 Drawing a grid which rotates

+&lt;code&gt;
 See main.cc in top directory.
+
+ray3d::game::PlaneGrid planegrid(dpyb.get_display(),&amp;amp;w,100,100);
+        planegrid.depth_f(0.55,0.55);
+        double perspectiveangle = PI/180*90;
+        planegrid.perspective(-2,2,perspectiveangle);
+        planegrid.map(&amp;amp;dpy,&amp;amp;w,"./pics/texturetest1.xpm",600,375);
+        //planegrid.depthperspective(2);
+        double thetax = 0.2;
+        double thetay = 0.2;
+        double thetaz = 0.2;
+
+        ray3d::Engine engine(thetax,0,0,0.9,100,10,1.2);
+        const char *colorname = "chartreuse";
+        XEvent e;
+
+for (int k = 0; k &lt; 100000; k++) {
+
+        /* blank screen */
+
+        XFillRectangle(dpy, titlebarw, gc,0,0,800,20);
+        XFillRectangle(dpy, w, gc,0,0,800,600);
+
+        /* draw 3d world */
+        planegrid.draw(dpyb.get_display(),&amp;amp;w, 100,100);
+        planegrid.perspective(-2,2,perspectiveangle);
+        planegrid.map(&amp;amp;dpy,&amp;amp;w,"./pics/texturetest1.xpm",600,375);
+        //////planegrid.rotate(engine, thetax, thetay, thetaz);
+
+        //NOTE: draw() is inside eventloop processor
+        xmantaray.eventloop(xmantaray,&amp;amp;e);
+
+        /* update movement of world */
+
+        perspectiveangle += 0.1;
+        thetax += 0.01;
+        thetay += 0.01;
+        thetaz += 0.01;
+
+        struct timespec ts;
+        ts.tv_sec = 0;        /* seconds */
+        ts.tv_nsec = 500000000;       /* nanoseconds */
+
+        //nanosleep(&amp;amp;ts,NULL);
+        XFlush(dpy);
+  }
+}
+&lt;/code&gt;
+
+### License : GPL version 2
+/*
+ Copyright (C) Johan Ceuppens 2011-2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see .
+*/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 08:15:51 -0000</pubDate><guid>https://sourceforge.net5c034fb146918afcd98f12e453df66bb4ac9059a</guid></item><item><title>examples modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/examples/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -15,7 +15,7 @@

 /* make cube model instance, width = 3 */

- ray3d::CubeModel pm5(dpyb.get_display(),&amp;amp;w,&amp;amp;gc,3);
+ ray3d::CubeModel cm(dpyb.get_display(),&amp;amp;w,&amp;amp;gc,3);

 /* make a matrix (e.g. for rotating) engine */

@@ -23,7 +23,7 @@

 /* fill it up with a color (given to draw_offset) */

- pm5.fill(dpyb.get_display(), &amp;amp;w,200,200); 
+ cm.fill(dpyb.get_display(), &amp;amp;w,200,200); 

 /* start a window event loop (also processes X11 events) */

@@ -33,15 +33,15 @@

 /* rotate cube with angles */

-     pm5.rotate(engine, thetax, thetay, thetaz); 
+     cm.rotate(engine, thetax, thetay, thetaz); 

 /* draw it at x == 200 , y == 200 pixels in the orange red color */

-     pm5.draw_offset(dpyb.get_display(), &amp;amp;w,200,200,200,const_cast("orange red"));
+     cm.draw_offset(dpyb.get_display(), &amp;amp;w,200,200,200,const_cast("orange red"));

 /* translate to z == -60 */

-     pm5.translate(engine, 0, 0, -60);
+     cm.translate(engine, 0, 0, -60);

 /* process window management e.g. moving via the titlebar */

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 08:12:15 -0000</pubDate><guid>https://sourceforge.net64786f841243ece8ff4199f00b277a7378e7e33b</guid></item><item><title>examples modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/examples/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 07:00:14 -0000</pubDate><guid>https://sourceforge.netee9b90afbafbc5d895fc847ac12be3aeb7e43454</guid></item><item><title>Hacks modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/Hacks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -1,5 +1,9 @@
 Examples 
 ----------
+
+### 0 Introduction
+
+These can be found in the examples directory, they replace your main.cc file.

 ### 1 Drawing a cube with normal mapping that moves to the right and rotates
 &lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 01:02:53 -0000</pubDate><guid>https://sourceforge.net2121af6f49e695cd03a0ecabe59a60ce68f0a867</guid></item><item><title>Hacks modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/Hacks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -55,6 +55,58 @@

 ### 2 Drawing a plane grid in a 3D world

+// See main.planegrid.cc
+{
+ double thetax = 1.2;
+ double thetay = 1.2;
+ double thetaz = 1.2;
+
+/* make planegrid model */
+
+ ray3d::game::PlaneGrid planegrid(dpyb.get_display(),&amp;amp;w,100,100);
+
+/* make a matrix (e.g. for rotating) engine */
+ 
+  ray3d::Engine engine(thetax,0,0,0.9,100,10,1.2); 
+
+/* give the plane a depth perspective, 2 far points and 2 near points */
+
+ planegrid.depth_f(0.55,0.55);
+
+/* put the planegrid further away in the 3D world */
+
+ planegrid.perspective(-20,20,PI/180*270);
+
+/* start a window event loop (also processes X11 events) */
+
+XEvent e;
+
+ for (;;) { 
+     
+/* rotate cube with angles */
+
+     
+    planegrid.rotate(engine, thetax, thetay, thetaz); 
+
+/* draw it */
+
+     planegrid.draw(dpyb.get_display(),&amp;amp;w, 100,100);
+
+
+/* process window management e.g. moving via the titlebar */
+
+     xmantaray.eventloop(xmantaray,&amp;amp;e);
+
+/* update rotating angles in radians */
+
+    thetax += 0.1;
+    thetay += 0.1;
+    thetaz += 0.1;
+
+}
+}
+
+
 ### 3 Drawing a grid which rotates

 See main.cc in top directory.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 01:01:52 -0000</pubDate><guid>https://sourceforge.netc483b7224e33a6a4ce6c3b441d1054203cf3496f</guid></item><item><title>Hacks modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/Hacks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -53,7 +53,8 @@
 }
 

+### 2 Drawing a plane grid in a 3D world

-### 2 Drawing a grid which rotates
+### 3 Drawing a grid which rotates

 See main.cc in top directory.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Sat, 03 Aug 2013 00:56:31 -0000</pubDate><guid>https://sourceforge.net44bb2f403290751953e4d52fbb9714f47750ad6d</guid></item><item><title>Hacks modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/Hacks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -52,3 +52,8 @@
 }
 }
 
+
+
+### 2 Drawing a grid which rotates
+
+See main.cc in top directory.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Fri, 02 Aug 2013 17:23:31 -0000</pubDate><guid>https://sourceforge.nete0bd73a5a241ee4128d2e340d6df07d43c5d3608</guid></item><item><title>Hacks modified by bubble</title><link>https://sourceforge.net/p/xmantaray2/wiki/Hacks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -4,20 +4,51 @@
 ### 1 Drawing a cube with normal mapping that moves to the right and rotates
 &lt;code&gt;
 // See main.orig.cc
-
+{
  double thetax = 1.2;
  double thetay = 1.2;
  double thetaz = 1.2;

- for (;;) {
-     ray3d::CubeModel pm5(dpyb.get_display(),&amp;amp;w,&amp;amp;gc,3);
-     pm5.fill(dpyb.get_display(), &amp;amp;w,200,200);
-     pm5.rotate(engine, thetax, thetay, thetaz);
-     pm5.draw_offset(dpyb.get_display(), &amp;amp;w,200,200,200,const_cast(""));
+/* make cube model instance, width = 3 */
+
+ ray3d::CubeModel pm5(dpyb.get_display(),&amp;amp;w,&amp;amp;gc,3);
+
+/* make a matrix (e.g. for rotating) engine */
+ 
+  ray3d::Engine engine(thetax,0,0,0.9,100,10,1.2); 
+
+/* fill it up with a color (given to draw_offset) */
+
+ pm5.fill(dpyb.get_display(), &amp;amp;w,200,200); 
+
+/* start a window event loop (also processes X11 events) */
+
+XEvent e;
+
+ for (;;) { 
+     
+/* rotate cube with angles */
+
+     pm5.rotate(engine, thetax, thetay, thetaz); 
+
+/* draw it at x == 200 , y == 200 pixels in the orange red color */
+
+     pm5.draw_offset(dpyb.get_display(), &amp;amp;w,200,200,200,const_cast("orange red"));
+
+/* translate to z == -60 */
+
      pm5.translate(engine, 0, 0, -60);
-     xmantaray.eventloop(xmantaray/*,&amp;amp;dpy*/,&amp;amp;e);
+
+/* process window management e.g. moving via the titlebar */
+
+     xmantaray.eventloop(xmantaray,&amp;amp;e);
+
+/* update rotating angles */
+
     thetax += 0.1;
     thetay += 0.1;
     thetaz += 0.1;
+
+}
 }
 &lt;/code&gt;
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bubble</dc:creator><pubDate>Fri, 02 Aug 2013 17:21:54 -0000</pubDate><guid>https://sourceforge.net8b336302d1f1020dce2f0a9867bf1c6e974ce598</guid></item></channel></rss>