<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Need  a program to create a 3D square ?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Need  a program to create a 3D square ?' posted on the '3D Graphics' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 10:25:49 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 10:25:49 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/203030/need--a-program-to-create-a-3d-square-/</link>
      <description>Hai all,&lt;br /&gt;
&lt;br /&gt;
      I am initiating a simple project in 3D graphics.I want to do the following things:&lt;br /&gt;
&lt;br /&gt;
           1)creating a simple square in 3D&lt;br /&gt;
           2)Move the sqaure to the given final position through some   intermediate position already given.&lt;br /&gt;
&lt;br /&gt;
        Please give your suggestions to do these things.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/203030/need--a-program-to-create-a-3d-square-/</guid>
      <pubDate>Wed, 23 Jul 2003 23:16:51 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/204935/re-need--a-program-to-create-a-3d-square-/#204935</link>
      <description>I would sugguest using OpenGL.&lt;br /&gt;
&lt;br /&gt;
Making a square is simple enough.&lt;br /&gt;
You specify the points (either hardcoded or in variable form) for the&lt;br /&gt;
corners of the first plain, then simply shift it back for the back panel. Rotate 90 degrees on the Y axis and shift 1/2 way left/right for the 2 side panels. Rotate 90 degrees on the X axis and shift 1/2 way up/down for the top and bottom panels.&lt;br /&gt;
&lt;br /&gt;
I haven't actually coded moving an object place to place in OpenGL yet, so I'm not sure how it works, but it shouldn't be hard.  Rotating all the planes on the cube (if you wanted to do so) is just one command, not one for each plane. I'm thinking movement should be similar.&lt;br /&gt;
&lt;br /&gt;
www.gametutorials.com has some very nice tutorials on OpenGL.&lt;br /&gt;
&lt;br /&gt;
Hope this helps,&lt;br /&gt;
JaguarZ&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/204935/re-need--a-program-to-create-a-3d-square-/#204935</guid>
      <pubDate>Sun, 03 Aug 2003 10:39:13 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/209487/re-need--a-program-to-create-a-3d-square-/#209487</link>
      <description>I would sugguest using OpenGL as well.&lt;br /&gt;
Command for moving objects is &lt;br /&gt;
glTranslate(x,y,z);&lt;br /&gt;
Nothing more to do after calling that than drawing whatever you want to draw.&lt;br /&gt;
&lt;br /&gt;
XLoom&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/209487/re-need--a-program-to-create-a-3d-square-/#209487</guid>
      <pubDate>Thu, 28 Aug 2003 06:38:12 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/210205/re-need--a-program-to-create-a-3d-square-/#210205</link>
      <description>hai,&lt;br /&gt;
   thanks for u'r reply.i have created the 3D object using opengl commands.now i want to recognize it as a sphere or cube or...&lt;br /&gt;
How can i do it?Is there any command to scan the lines or pixels and to measure the angle between the lines?&lt;br /&gt;
                                           roselin&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/210205/re-need--a-program-to-create-a-3d-square-/#210205</guid>
      <pubDate>Mon, 01 Sep 2003 21:07:15 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/210274/re-need--a-program-to-create-a-3d-square-/#210274</link>
      <description>No, there is no way (from OpenGL point of view), there may be other ways to recognize as cube or sphere. All OpenGL does is render triangles on screen. The system doesn't have any notion of sphere cube or anything. And No there is no function to calculate the angle between two line in OpenGL - its purely a graphical API, you need to use trignometry to do that. Its not that difficult. &lt;br /&gt;
&lt;br /&gt;
: hai,&lt;br /&gt;
:    thanks for u'r reply.i have created the 3D object using opengl commands.now i want to recognize it as a sphere or cube or...&lt;br /&gt;
: How can i do it?Is there any command to scan the lines or pixels and to measure the angle between the lines?&lt;br /&gt;
:                                            roselin&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/210274/re-need--a-program-to-create-a-3d-square-/#210274</guid>
      <pubDate>Tue, 02 Sep 2003 07:28:34 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/210298/re-need--a-program-to-create-a-3d-square-/#210298</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I don't quite understand the question. Do you mean that you want to draw the cube or sphere first and pretend you don't know what you have drawn and then try to make computer to recognize whether it is a cube or sphere? If so then first you need to get the image to memory with&lt;br /&gt;
&lt;br /&gt;
void glReadPixels(GLint x,&lt;br /&gt;
                  GLint y,&lt;br /&gt;
                  GLsizei width,&lt;br /&gt;
                  GLsizei height,&lt;br /&gt;
                  GLenum format,&lt;br /&gt;
                  GLenum type,&lt;br /&gt;
                  GLvoid *pixels);&lt;br /&gt;
&lt;br /&gt;
(Description of this function can be found from&lt;br /&gt;
&lt;a href="http://www.mevis.de/~uwe/opengl/glReadPixels.html)"&gt;http://www.mevis.de/~uwe/opengl/glReadPixels.html)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And after doing this, you find the edges of the object and check whether they are on one line (for cube edge) or do any two farthest edgepoints have the same average (for sphere) or whatever you need to find out.&lt;br /&gt;
Is this what you meant?&lt;br /&gt;
Anyway I hope it helps ;), even if it has no connection to the question :)&lt;br /&gt;
&lt;br /&gt;
XLoom&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/210298/re-need--a-program-to-create-a-3d-square-/#210298</guid>
      <pubDate>Tue, 02 Sep 2003 09:18:46 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/210860/re-need--a-program-to-create-a-3d-square-/#210860</link>
      <description>hai,&lt;br /&gt;
   &lt;br /&gt;
  Thank u very much for u'r reply.It's really what i am seeking.Now i got it.if i have any doubt i will contact u.Agin ,lot of thanks...&lt;br /&gt;
&lt;br /&gt;
                                                     roselin&lt;br /&gt;
&lt;br /&gt;
: Hi,&lt;br /&gt;
: &lt;br /&gt;
: I don't quite understand the question. Do you mean that you want to draw the cube or sphere first and pretend you don't know what you have drawn and then try to make computer to recognize whether it is a cube or sphere? If so then first you need to get the image to memory with&lt;br /&gt;
: &lt;br /&gt;
: void glReadPixels(GLint x,&lt;br /&gt;
:                   GLint y,&lt;br /&gt;
:                   GLsizei width,&lt;br /&gt;
:                   GLsizei height,&lt;br /&gt;
:                   GLenum format,&lt;br /&gt;
:                   GLenum type,&lt;br /&gt;
:                   GLvoid *pixels);&lt;br /&gt;
: &lt;br /&gt;
: (Description of this function can be found from&lt;br /&gt;
: &lt;a href="http://www.mevis.de/~uwe/opengl/glReadPixels.html)"&gt;http://www.mevis.de/~uwe/opengl/glReadPixels.html)&lt;/a&gt;&lt;br /&gt;
: &lt;br /&gt;
: And after doing this, you find the edges of the object and check whether they are on one line (for cube edge) or do any two farthest edgepoints have the same average (for sphere) or whatever you need to find out.&lt;br /&gt;
: Is this what you meant?&lt;br /&gt;
: Anyway I hope it helps ;), even if it has no connection to the question :)&lt;br /&gt;
: &lt;br /&gt;
: XLoom&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/210860/re-need--a-program-to-create-a-3d-square-/#210860</guid>
      <pubDate>Fri, 05 Sep 2003 03:19:01 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/231494/re-need--a-program-to-create-a-3d-square-/#231494</link>
      <description>: Hai all,&lt;br /&gt;
: &lt;br /&gt;
:       I am initiating a simple project in 3D graphics.I want to do the following things:&lt;br /&gt;
: &lt;br /&gt;
:            1)creating a simple square in 3D&lt;br /&gt;
:            2)Move the sqaure to the given final position through some   intermediate position already given.&lt;br /&gt;
: &lt;br /&gt;
:         Please give your suggestions to do these things.&lt;br /&gt;
: &lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
     Hello, there&lt;br /&gt;
&lt;br /&gt;
     You say you want to make a simple square in 3D(a cube or square?)&lt;br /&gt;
and that's simple. You either use the command "auxWireCube()" for a wireframe cube or "auxSolidCube" for a solid cube or either you create your own cube with the "glVertex3f(x,y,z)" function(The prefferable option).&lt;br /&gt;
     For a square you colud also use the "gl Vertex\(x,y,z)" function as follows:&lt;br /&gt;
&lt;br /&gt;
     glBegin(GL_SQUARE);  //you could also use GL_POLYGON&lt;br /&gt;
     {&lt;br /&gt;
         glVertex3f(0.0,0.0,0.0);&lt;br /&gt;
         glVertex3f(0.0,1.0,0.0);&lt;br /&gt;
         glVertex3f(1.0,1.0,0.0);&lt;br /&gt;
         glVertex3f(1.0,0.0,0.0);&lt;br /&gt;
     }&lt;br /&gt;
     glEnd();  &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/231494/re-need--a-program-to-create-a-3d-square-/#231494</guid>
      <pubDate>Mon, 15 Dec 2003 04:01:44 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
    <item>
      <title>Re: Need  a program to create a 3D square ?</title>
      <link>http://www.programmersheaven.com/mb/3d-graphics/203030/374624/re-need--a-program-to-create-a-3d-square-/#374624</link>
      <description>: Hai all,&lt;br /&gt;
: &lt;br /&gt;
:       I am initiating a simple project in 3D graphics.I want to do &lt;br /&gt;
: the following things:&lt;br /&gt;
: &lt;br /&gt;
:            1)creating a simple square in 3D&lt;br /&gt;
:            2)Move the sqaure to the given final position through &lt;br /&gt;
: some   intermediate position already given.&lt;br /&gt;
: &lt;br /&gt;
:         Please give your suggestions to do these things.&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
I am giving code for 3D square in turbo c&lt;br /&gt;
&lt;br /&gt;
/* Program for 3D square&lt;br /&gt;
&lt;br /&gt;
By:&lt;br /&gt;
   Mitul Golakiya&lt;br /&gt;
&lt;br /&gt;
E-Mail ID : mitulgolakiya@yahoo.com&lt;br /&gt;
            mitul.gorkiya@avinashi.com&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
#include &amp;lt;graphics.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;conio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
	int x = 250, y = 200;&lt;br /&gt;
	int gd = DETECT, gm;&lt;br /&gt;
	initgraph(&amp;amp;gd, &amp;amp;gm, "E:\\TC\\BGI");&lt;br /&gt;
	moveto(x, y+100);&lt;br /&gt;
	lineto(x, y);&lt;br /&gt;
	lineto(x+25, y-25);&lt;br /&gt;
	lineto(x+125, y-25);&lt;br /&gt;
	line(x, y, x+100, y);&lt;br /&gt;
	line(x, y+100, x+100, y+100);&lt;br /&gt;
&lt;br /&gt;
	moveto(x+100, y);&lt;br /&gt;
	lineto(x+100, y+100);&lt;br /&gt;
	lineto(x+125, y+75);&lt;br /&gt;
	lineto(x+125, y-25);&lt;br /&gt;
	lineto(x+100, y);&lt;br /&gt;
&lt;br /&gt;
	setlinestyle(2, 1, 1);&lt;br /&gt;
	line(x+25, 175, x+25, y+75);&lt;br /&gt;
	line(x+25, 275, x, y+100);&lt;br /&gt;
	line(x+25, 275, x+125, y+75);&lt;br /&gt;
&lt;br /&gt;
	getch();&lt;br /&gt;
	getch();&lt;br /&gt;
	closegraph();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=195"&gt;3DVIEW.CPP&lt;/a&gt; (641 bytes | downloaded 242 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/3d-graphics/203030/374624/re-need--a-program-to-create-a-3d-square-/#374624</guid>
      <pubDate>Thu, 28 Aug 2008 20:16:34 -0700</pubDate>
      <category>3D Graphics</category>
    </item>
  </channel>
</rss>