IonicWind Software

Creative Basic => 2D/3D => Topic started by: ZeroDog on July 20, 2009, 12:35:02 PM

Title: D3DShapeEx Component
Post by: ZeroDog on July 20, 2009, 12:35:02 PM
This is a component extension for Creative Basic. It is used in the same manner as the D3DShape function, and the shapes created with it can be manipulated as any other shape created with the D3DShape function by using the D3DCommand function.

Current Version 1.02

Currently there are 8 shapes available:
@SHAPEPLANE
@SHAPEPLANECUBE
@SHAPERADFACE
@SHAPERADFACECYLINDER
@SHAPEHOLLOWRADFACE
@SHAPEHOLLOWRADFACECYLINDER
@SHAPERADFACECONE
@SHAPEHOLLOWRADFACECONE

I am planning on implementing the following shapes soon:
@SHAPERADFACEFRUSTRUM
@SHAPEHOLLOWRADFACEFRUSTRUM
@SHAPETORUS
@SHAPESPRING
and perhaps some others.

History:
* Updated to version 1.02 - Added @SHAPEHOLLOWRADFACECONE.  Changed the demo source code to run 800x600 instead of 640x480.

* Updated to version 1.01 - Added @SHAPERADFACECONE

* Version 1.0 released - Intially @SHAPEPLANE, @SHAPEPLANECUBE, @SHAPERADFACE, @SHAPERADFACECYLINDER, @SHAPEHOLLOWRADFACE, @SHAPEHOLLOWRADFACECYLINDER

* I started work on this in IBasic Std, but, the community was in a bit of turmoil at the time, and the code had some problems so alot of users may have missed this.  Its now stable, and should work properly, so I will be updating this component with more shapes as time goes on.  I will be creating a complete scene to fully demonstrate the function in the future.

The zip file attached contains the component, the source code for the component, source code of a demo of using the function, and a small HTML users guide.

All comments, ideas and suggestions and questions are always welcome.

Happy Coding!  :)
Title: Re: D3DShapeEx Component
Post by: aurelCB on July 20, 2009, 01:32:43 PM
Zero this sounds great but i recive error
'===== Initialize D3DShapeEx =====
GOSUB InitD3DShapeEx

'Undefined label on line 5  - why is that?
I unpack your zip in Creative samples folder and create component i think properly ::)
Where is the catch?

aurel
Title: Re: D3DShapeEx Component
Post by: ZeroDog on July 20, 2009, 01:43:40 PM
You need to add the component to the project.  From the IDE menu, select Component and then Include/remove.  Then browse to the componnt file  D3DShapeEx.cbo  (or the name that you gave it when you created the component).   Its not the same as a command pak in EBasic.  you must add the component manually to any project that you want to use the D3DShapeEx function with. 
Title: Re: D3DShapeEx Component
Post by: aurelCB on July 20, 2009, 02:13:30 PM
Yes Zero , sorry i'm not very used for that stuff and i forget how this things work.
finaly i make D3 exe and work fine but only as 640x480 window.But ok looks exellent.
And just one thing , my antivirus makes me crazy "paranoid Avira" it looks that dont know what is
that program is  ;D - so i must turn off AVIRA and then all works.
Thanks for this great example.
And just one question if is no problem.
This component , is this similiar thing like include file in EBasic?

all best
zlatko
Title: Re: D3DShapeEx Component
Post by: ZeroDog on July 20, 2009, 02:33:54 PM
Quote"work fine but only as 640x480 window."
Perhaps your video card does not support the older smaller resolutions anymore.  Try changing line 18 to:

if create3dscreen(win,800,600,16)<>0

and see if that works.

Quote"This component , is this similiar thing like include file in EBasic?"
yes, it is like the include files in EBasic, or like a DLL file.  You write some functions that you want to use, and make a component out of it, so you can use the functions in any of your Creative Basic projects without having to copy and paste the code.

There are a few components on the internet for Creative Basic or IBasic Standard (both are mostly interchangable).  I'll see if I can dig some up and I'll post them on the forums. 
Title: Re: D3DShapeEx Component
Post by: aurelCB on July 20, 2009, 10:41:26 PM
Thanks Zero  :)
I always ask myself what is the purpose of components?
But i never post question here...
Title: Re: D3DShapeEx Component
Post by: ZeroDog on July 25, 2009, 12:00:13 AM
You can now use @SHAPERADFACECONE.  Version is now 1.01   :)
Title: Re: D3DShapeEx Component
Post by: ZeroDog on July 27, 2009, 04:30:13 PM
Just updated to version 1.02.  @SHAPEHOLLOWRADFACECONE has now been added.