Page 1 of 1

Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 3:01 pm
by STARGÅTE
This include is an extension to the Drawing library to draw lines, triangles, or boxes in three-dimensional space. The whole is based on pure drawing and CPU instructions, so no additional DLLs. The include should not be used as a 3D engine (it's too slow), but to render small scenes.

Drawing3D.zip
Inlcude, a demo and five examples.
  • With StartDrawing3D() : StopDrawing3D() the environment is opened.
  • With Drawing3DMode() you can select or #Drawing3D_Outline or #Drawing3D_Default
  • Drawing3DPosition() and Drawing3DRotation() to change the position and rotation of the scene
  • All colors are always specified in 32-bit ($FF00FF00 for Green)
  • Drawing3DBackground() fill the area with the specified color. (if the alpha value is 0, the background is really transparent, useful for 32-bit images)
  • Drawing3DLight() sets a light (indicating where it comes from) in the scene
  • DrawPoint3D() DrawLine3D() and DrawTriangle3D() is a point, line or triangle (with vertex colors)
  • At DrawPlane3D(), DrawImage3D() and DrawBox3D() only the position, size and rotation is specified.
  • CreateImage3D () creates a Image3D from the image
Here is an example of a Drawing3D scene with a transparent background.
Image

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 4:21 pm
by Danilo
Thank you very much! Really amazing! Image

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 4:27 pm
by Fred
Yes, it's really good !

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 6:18 pm
by Little John
Hi Stargate,

really amazing, and might be very useful for a project of mine in the future. Image
Thank you very much for sharing!

I made an observation, and don't know whether or not that effect is intended.
After running Example03.pb, I get this result:

[Image removed]

What about the small area that I have marked with a black polygon here:

[Image removed]

Is the different color of that area an artefact?

Regards, Little John

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 6:33 pm
by luciano
Is the different color of that area an artefact?
No, I think it is a part of the rear face of the magenta cube.

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 7:24 pm
by STARGÅTE
These boxes are transparent (25%), you see the rear face that is lighter because it is lighted.

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 7:34 pm
by Little John
I see. I think I'll have to train my 3-D imagination. :-)
Thanks.

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 11:00 pm
by idle
very nice thanks

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Sun Feb 03, 2013 11:48 pm
by eddy
Great job! :D

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Mon Feb 04, 2013 12:16 am
by Andre
After commenting the WinAPI command calls (QueryPerformanceCounter_() - it seems to be not urgently needed!?) it's also working fine on MacOS 10.5.8.

Well done! Thanks a lot! :D

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Mon Feb 04, 2013 12:24 am
by netmaestro
Truly excellent work and very useful for making stunning projects! Thanks a lot for this 8) 8) 8)

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Mon Feb 04, 2013 1:12 am
by STARGÅTE
Andre wrote:After commenting the WinAPI command calls (QueryPerformanceCounter_() - it seems to be not urgently needed!?) it's also working fine on MacOS 10.5.8.

Well done! Thanks a lot! :D
No, it is only for measure the time to render the scene

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Wed Jun 19, 2013 2:35 pm
by em_uk
Genius!

Thanks!

Re: Drawing3D - Draw commands for 3D Scenes

Posted: Wed Jun 19, 2013 4:21 pm
by heartbone
STARGÅTE, you posted this before I joined and I had not seen it until now.
I now plan to use your extension in the port of INTERSHIP (version 3) from 2½D to 3D.
Thanks for the contribution and I'd like to mention you in the game's credits.
As much as I enjoyed the TV show, I'd prefer using a real name over inserting STARGÅTE.
If and when I come close to completing my little freeware game,
I'll contact you to see if I can credit you by real name. ;)

Image
http://www.acid-play.com/download/intership
The reviewer was a bit harsh considering the original gameplay design of my over 10 year old work. However in three dimensions I'll be able to have better eye candy rocket attacks, splashes, waves, explosions, ship sinking animations, and oil slicks. Using your extension should decrease the time needed to port the simulation into 3D.
Thanks again.