It is currently Thu Feb 25, 2021 8:24 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 3:01 pm 
Online
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1391
Location: Germany, Glienicke
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

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 4:21 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2999
Location: Planet Earth
Thank you very much! Really amazing! Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 4:27 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
Yes, it's really good !


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 6:18 pm 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3972
Location: Berlin, Germany
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

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Last edited by Little John on Sun Feb 03, 2013 7:36 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 6:33 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Mar 09, 2011 8:25 pm
Posts: 151
Quote:
Is the different color of that area an artefact?

No, I think it is a part of the rear face of the magenta cube.


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 7:24 pm 
Online
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1391
Location: Germany, Glienicke
These boxes are transparent (25%), you see the rear face that is lighter because it is lighted.

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 7:34 pm 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3972
Location: Berlin, Germany
I see. I think I'll have to train my 3-D imagination. :-)
Thanks.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 11:00 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3567
Location: New Zealand
very nice thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Sun Feb 03, 2013 11:48 pm 
Offline
Addict
Addict
User avatar

Joined: Mon May 26, 2003 3:07 pm
Posts: 1477
Location: Nantes
Great job! :D

_________________
Imagewin8.1 x64 5.31 | IDE | PB plugin | Tools | Sprite | JSON | visual tool


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Mon Feb 04, 2013 12:16 am 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1873
Location: Germany (Saxony, Deutscheinsiedel)
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

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Mon Feb 04, 2013 12:24 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 8149
Location: Fort Nelson, BC, Canada
Truly excellent work and very useful for making stunning projects! Thanks a lot for this 8) 8) 8)

_________________
BERISHEET


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Mon Feb 04, 2013 1:12 am 
Online
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1391
Location: Germany, Glienicke
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

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Wed Jun 19, 2013 2:35 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Aug 08, 2010 3:32 pm
Posts: 362
Location: Manchester UK
Genius!

Thanks!

_________________
----

R Tape loading error, 0:1


Top
 Profile  
Reply with quote  
 Post subject: Re: Drawing3D - Draw commands for 3D Scenes
PostPosted: Wed Jun 19, 2013 4:21 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
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.

_________________
Keep it BASIC.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye