Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Simple Cube Vertices


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 jai   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 July 2001 - 11:45 PM

Hi, I''m fairly new to 3D programming and I''m trying to simply get a 3D cube on the screen using Drirect3D Imediate mode (DirextX7) If I set up some vectors and use draw primitive using D3DPT_TRIANGLELIST. I get some of the sides coming out all funny. Can some one tell me how to work out what order to draw the trianlges in. Or show me a simple way or drawing a 3d cube. Thanks, Jai

Sponsor:

#2 Dobbs   Members   -  Reputation: 164

Like
Likes
Like

Posted 01 August 2001 - 04:40 PM

Without knowing more, my first guess would be that you''re probably not specifying the vertices of the triangle list in the correct order.

Oh, and I''m pretty sure you can''t draw a six faced cube with just a single triangle strip. Think about it. If you had a strip of triangles could you fold it to make a cube?

#3 Beer Hunter   Members   -  Reputation: 712

Like
Likes
Like

Posted 02 August 2001 - 11:59 PM

A cube can be drawn with a triangle strip, with a little effort.

I''m not a 3d programmer, but I can give a set of co-ordinates which should draw a cube. I''ve listed which triangle each co-ordinate completes.

(0, 0, 0)
(1, 0, 0)
(1, 0, 1) <-- first triangle on bottom of cube
(1, 1, 0) <-- first triangle on right of cube
(1, 1, 1) <-- second triangle on right of cube
(0, 1, 1) <-- first triangle on top of cube
(1, 0, 1) <-- first triangle on back of cube
(0, 0, 1) <-- second triangle on back of cube
(0, 0, 0) <-- second triangle on bottom of cube
(0, 1, 1) <-- first triangle on left of cube
(0, 1, 0) <-- second triangle on left of cube
(1, 1, 0) <-- second triangle on top of cube
(0, 0, 0) <-- first triangle on front of cube
(1, 0, 0) <-- second triangle on front of cube

That should work.

#4 Dobbs   Members   -  Reputation: 164

Like
Likes
Like

Posted 03 August 2001 - 11:26 AM

Ah stupid me, I was thinking of a strip of quads, not triangles.

#5 jai   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 August 2001 - 07:07 PM

Thanks for that. I was drawing the triangles in the wrong order.

Edited by - jai on August 4, 2001 2:13:39 AM




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS