Drawing Triangles (For my 3D engine)

I'm writing my own 3D engine, but...

Page 1 of 1

8 Replies - 3628 Views - Last Post: 17 November 2005 - 10:56 AM Rate Topic: -----

#1 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

Drawing Triangles (For my 3D engine)

Post icon  Posted 15 November 2005 - 11:00 AM

Ok, I have a buffer of pixels from DirectDraw, Right? Right.

I made a SET_PIXEL macro to set pixels.
I figured out how to draw a solid line like that.
I also know how to draw a scaled slice of a bitmap instead of a color.
I can draw a scaled square bitmap image easily (Source RECT to Destination RECT).

But...

How in the world do I draw a triangle? Does anybody know how? The only clue I have is to use the slice bitmap line drawer!

Once that is complete, I can build a 3D engine off of that and optimize it. I'm not using Direct3D or OpenGL's 3D system, i'm writing my own and it's a very difficult task.

Do you have any idea on how to draw a triangle?

Is This A Good Question/Topic? 0
  • +

Replies To: Drawing Triangles (For my 3D engine)

#2 Vextor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 313
  • Joined: 22-May 02

Re: Drawing Triangles (For my 3D engine)

Posted 15 November 2005 - 01:00 PM

Unfortunately i'm not as advanced w/ c++ as I can be yet and I can offer no help what so ever. I am, however, curious to find the answer to the question out. You say this is homework - for what kind of class?
Was This Post Helpful? 0
  • +
  • -

#3 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: Drawing Triangles (For my 3D engine)

Posted 15 November 2005 - 01:07 PM

Why are you reinventing the wheel?

DirectDraw was never made to do this, Direct3d has been optimized way way deep in its core, so what do you have to gain from trying to implement 3d using a 2d engine?
Was This Post Helpful? 0
  • +
  • -

#4 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

Re: Drawing Triangles (For my 3D engine)

Post icon  Posted 16 November 2005 - 10:58 AM

1: This is for something I am doing on my own.

2: That didn't answer my question, but I'm writing my own 3D engine because I want to. I read a tutorial on drawing interpolated lines and the guy said I could write a texture mapped 3D engine if I knew how to draw triangles with the line. I'm 're-inventing the wheel' because I want to (and I saw the finished product in a dream).

Now... Does anybody know any idea or clue about how to draw a triangle with a interpolated line?

I need some help...

(Oh yeah! And Direct3D is mircosoft complicated which is another reason).

This post has been edited by WolfCoder: 16 November 2005 - 10:59 AM

Was This Post Helpful? 0
  • +
  • -

#5 damoun  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 36
  • Joined: 07-August 05

Re: Drawing Triangles (For my 3D engine)

Posted 16 November 2005 - 06:56 PM

Read this:
Tricks of the 3D Game Programming Gurus-Advanced 3D Graphics and Rasterization(by Andre LaMothe).
The book teaches creating a 3D texture-mapped, lit video game for the PC with a software rasterizer which can be written by the reader. The book also covers the principles of 3D graphics.
Was This Post Helpful? 0
  • +
  • -

#6 damoun  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 36
  • Joined: 07-August 05

Re: Drawing Triangles (For my 3D engine)

Posted 16 November 2005 - 07:06 PM

you will also be able to get some more help from: (www.gamedev.net)
fourms, see how that goes!
Was This Post Helpful? 0
  • +
  • -

#7 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

Re: Drawing Triangles (For my 3D engine)

Post icon  Posted 17 November 2005 - 10:50 AM

NO! NO! NO!!!!

...

I am not asking for books and stuff,

I am asking for anyone who knows how to draw a triangle using a draw_line function!

Please, please, please don't ask me why, just help.

Please.
Was This Post Helpful? 0
  • +
  • -

#8 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: Drawing Triangles (For my 3D engine)

Posted 17 November 2005 - 10:52 AM

Go to gamedev and ask there, thats along the lines of the sick things they do there.
Was This Post Helpful? 0
  • +
  • -

#9 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

Re: Drawing Triangles (For my 3D engine)

Post icon  Posted 17 November 2005 - 10:56 AM

<Whine!>

But i'm asking for people in D.I.C.

</Whine!>
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1