Page 7 of 8

Posted: Fri Jul 01, 2005 5:12 pm
by Psychophanta
Stefan, this example is another way to see what's happening with current S3DR lib.
At the left side there is a normal cube mesh rotated 45 degrees over X axis.
At right side there is a cube mesh design with a 45 degrees over X axis.
Then, when both figures are displayed you can rotate it over Y axis (with cursor keys left and right) and then you can see that something is wrong:

Code: Select all

#PI=3.14159265
InitSprite():InitSprite3D():InitKeyboard()
OpenScreen(1024,768,32,"")

UsePNGImageDecoder()
LoadSprite(1,"yourspritehere",#PB_Sprite_Texture); <- a 256x256x8 graph image should be good
S3DR_CreateZBuffer()

;Create the cube
Start3D():S3DR_BeginReal3D()
S3DR_StartCreateMesh()
S3DR_CreateMesh_AddQuad(-1, 1, 1,-1, 1,-1,-1,-1, 1,-1,-1,-1);<-cara izquierda
S3DR_CreateMesh_AddQuad( 1,-1, 1,-1,-1, 1, 1,-1,-1,-1,-1,-1);<-cara de abajo
S3DR_CreateMesh_AddQuad(-1, 1, 1, 1, 1, 1,-1, 1,-1, 1, 1,-1);<-cara de arriba
S3DR_CreateMesh_AddQuad(1,1,1,-1,1,1,1,-1,1,-1,-1,1);<-cara de atras
S3DR_CreateMesh_AddQuad(-1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1);<-cara de enfrente
S3DR_CreateMesh_AddQuad( 1, 1,-1, 1, 1, 1, 1,-1,-1, 1,-1, 1);<-cara derecha
Cube=S3DR_StopCreateMesh()
S3DR_EndReal3D():Stop3D()

;Create a cube rotated 45 degrees over X axis
Start3D():S3DR_BeginReal3D()
S3DR_StartCreateMesh()
 S3DR_CreateMesh_AddQuad(-1,Sqr(2),0,-1,0,-Sqr(2),-1,0,Sqr(2),-1,-Sqr(2),0);<-cara izquierda
 S3DR_CreateMesh_AddQuad(1,0,Sqr(2),-1,0,Sqr(2),1,-Sqr(2),0,-1,-Sqr(2),0);<-cara de abajo
 S3DR_CreateMesh_AddQuad(-1,Sqr(2),0,1,Sqr(2),0,-1,0,-Sqr(2),1,0,-Sqr(2));<-cara de arriba
 S3DR_CreateMesh_AddQuad(1,Sqr(2),0,-1,Sqr(2),0,1,0,Sqr(2),-1,0,Sqr(2));<-cara de atras
 S3DR_CreateMesh_AddQuad(-1,0,-Sqr(2),1,0,-Sqr(2),-1,-Sqr(2),0,1,-Sqr(2),0);<-cara de enfrente
 S3DR_CreateMesh_AddQuad(1,0,-Sqr(2),1,Sqr(2),0,1,-Sqr(2),0,1,0,Sqr(2));<-cara derecha
Cube2=S3DR_StopCreateMesh()
S3DR_EndReal3D():Stop3D()

Sprite3DQuality(1)

Repeat
  ExamineKeyboard()
  Start3D():S3DR_BeginReal3D()
  S3DR_ClearScreenAndZBuffer(0);<- clear screen in black color
  StartDrawing(ScreenOutput()):Locate(400,200):DrawText("Rotating over world Y axis:")
  Locate(320,240):DrawText("bad done:")
  Locate(640,240):DrawText("well done:"):StopDrawing()
  
  If KeyboardPushed(#PB_Key_Right):angleY.f-0.02:EndIf; <- rotate over Y axis of the world ?
  If KeyboardPushed(#PB_Key_Left):angleY.f+0.02:EndIf; <- rotate over Y axis of the world ?
  S3DR_SelectTexture(1)
  
;********************** DRAWING ****************************
; The cube at the left side, a normal cube mesh rotated 45 degrees over X axis:
  S3DR_DrawMesh(Cube,-2,0,16,-#PI/4,angleY.f,0)
; The cube at the right side, a cube mesh designed rotating 45 degrees over X axis:
  S3DR_DrawMesh(Cube2,2,0,16,0,angleY.f,0)
;********************************************************

  S3DR_EndReal3D():Stop3D()
  FlipBuffers():Delay(16)
Until KeyboardPushed(#PB_Key_Escape)
S3DR_FreeMesh(Cube2); Don't forget to free the Mesh.
S3DR_FreeMesh(Cube); Don't forget to free the Mesh.
Hope you see it.

Posted: Fri Jul 01, 2005 7:26 pm
by S.M.
@Psychophanta
Yes, I see...
The problem is, that I don't know how to correct this using Direct3D7.
The only thing I could do at the moment is transforming the vertices
on my own...
Thanks for the example.
Psychophanta wrote:Is it a Direct3D problem????
No, I think it's no issue of Direct3D.
- added ability to use software-rendering
Can someone provide with some example of this?
Just use

Code: Select all

S3DR_CreateZBuffer(#S3DR_SoftwareDevice)
Instead of

Code: Select all

S3DR_CreateZBuffer()
@Shannara
Shannara wrote:I can provide ftp account and download space (no file size limitations) @
http://www.officialmirrors.com
The domain doesn't exist. :? :?:
@djes
djes wrote:Could you add a png loader with alpha layer?
Sorry,but this feature isn't available in Direct3D 7, which is used by my Library.
If I'd write a Library with Direct3D 8,it would be one of the first things on my list.
regards
Stefan

Posted: Fri Jul 01, 2005 7:32 pm
by Psychophanta
Why don't use last version of direct 3D ? It should implicate to rewrite all your lib again ? :?

Posted: Fri Jul 01, 2005 7:51 pm
by S.M.
Yes, there are many differences between Direct3D7 and Direct3D8/Direct3D9, so I
would need to rewrite nearly all the code.
Another point is,that the 3D-Engine wouldn't be compatible with the other
Libraries of Purebasic (Sprite,Keyboard,Joystick,Sound).
Therefore I would need to write a complete collection of 2D/3D/Sound/Input functions.

On the other hand using Direct3D8/Direct3D9 would have many advantages... :roll:

Posted: Fri Jul 01, 2005 8:04 pm
by Psychophanta
S.M. wrote:Yes, there are many differences between Direct3D7 and Direct3D8/Direct3D9, so I
would need to rewrite nearly all the code.
Another point is,that the 3D-Engine wouldn't be compatible with the other
Libraries of Purebasic (Sprite,Keyboard,Joystick,Sound).
Therefore I would need to write a complete collection of 2D/3D/Sound/Input functions.

On the other hand using Direct3D8/Direct3D9 would have many advantages... :roll:
I wouldn't doubt :wink:

Posted: Fri Jul 01, 2005 9:40 pm
by Shannara
www.officialmirror.com , i accidently added an "s". :)

Front page won't show anything, but a current list of mirriors are found @ http://www.officialmirror.com/mirrors

Posted: Fri Jul 01, 2005 9:53 pm
by djes
Ok, thanks! I'll be patient ;)

Posted: Sun Jul 03, 2005 9:02 am
by Psychophanta
As a request, you could make a DX9 version for the newest VGAs and keep the DX7 version. :)

Posted: Sun Jul 03, 2005 11:44 am
by S.M.
@Shannara
Ok, but what do you want for exchange?
where is the hook ? :wink:

@Psychophanta
Psychophanta wrote: As a request, you could make a DX9 version for the newest VGAs and keep the DX7 version. :)
If I do it, I will use DirectX8, because it works better with older Cards and
I could use the "DirectX8 type library for VB" for loading meshes and textures.
The problem is that it's really much work and I also have many things on my
To-Do-List for the Sprite3DReal-Library.
But, my holidays start in 4 weeks, so maybe I have time for doing it... 8)

Somebody here who wants to help me ? :wink:
regards
Stefan

Posted: Sun Jul 03, 2005 1:08 pm
by Psychophanta
The the best choice now should be to finish the current lib :)

Posted: Sun Jul 03, 2005 5:49 pm
by Shannara
No hook, as I stated to GPI when I hosted a mirror for JaPBe, there are no hooks, I have the spare bandwidth, why not put it to good use? Actually, in all honesty, there are no hooks :) If you can trust me as a download mirror, I can provide you with a ftp account for uploading to the site.

Posted: Sun Jul 03, 2005 11:58 pm
by chris_b
S.M. wrote:
djes wrote:Could you add a png loader with alpha layer?
Sorry,but this feature isn't available in Direct3D 7, which is used by my Library.
:?: This feature is available in Blitz3D which uses Direct3D 7

Posted: Mon Jul 04, 2005 5:00 am
by Brice Manuel
This feature is available in Blitz3D which uses Direct3D 7
D3D 7 can't load PNGs. Blitz 3D uses a third-party lib for loading images.

Posted: Wed Sep 07, 2005 9:50 pm
by xperience2003
any news , stefan???

Posted: Wed Sep 07, 2005 11:08 pm
by djes
Spritedx9 do the job.