April 24, 2024, 06:05:53 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


D3DShapeEx Component

Started by ZeroDog, July 20, 2009, 12:35:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZeroDog

July 20, 2009, 12:35:02 PM Last Edit: July 27, 2009, 04:32:39 PM by ZeroDog
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!  :)

aurelCB

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

ZeroDog

July 20, 2009, 01:43:40 PM #2 Last Edit: July 20, 2009, 01:47:02 PM by ZeroDog
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. 

aurelCB

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

ZeroDog

July 20, 2009, 02:33:54 PM #4 Last Edit: July 20, 2009, 02:40:52 PM by ZeroDog
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. 

aurelCB

Thanks Zero  :)
I always ask myself what is the purpose of components?
But i never post question here...

ZeroDog

You can now use @SHAPERADFACECONE.  Version is now 1.01   :)

ZeroDog

Just updated to version 1.02.  @SHAPEHOLLOWRADFACECONE has now been added.