IonicWind Software

IWBasic => General Questions => Topic started by: Swos2008 on June 22, 2008, 12:40:30 PM

Title: Basic 3D Models Screenshot
Post by: Swos2008 on June 22, 2008, 12:40:30 PM
Hiya all,

3DWORLD STUDIO
(http://www1.picturepush.com/photo/a/853234/640/853234.png) (http://www.picturepush.com/public/853234)

then I load the mesh in Ebasic.

Ebasic Versions
(http://www2.picturepush.com/photo/a/855005/640/855005.bmp) (http://www.picturepush.com/public/855005)

I dont think I have put camera range for Ebasic yet. Does  Ebasic have Camera Range?

cheers
Title: Re: Basic 3D Models Screenshot
Post by: Barney on June 22, 2008, 01:46:24 PM
Check hellp files under "Classes". You'll find C3DCamera class. Take a look at SetBackPlane and SetFrontPlane methods.

Also, don't forget to set the lights.

Barney
Title: Re: Basic 3D Models Screenshot
Post by: Swos2008 on June 24, 2008, 03:34:07 PM
I click on Help files then 3D Commands Gudie and nothings happen....why is that?

The source code is the same as skinnedXmesh example and I would like add the camera range but I am not sure how to do that.


' Mesh example

'Arrow keys to move camera.
'PgUp/PgDn to pan up and down.
'Z and X to rotate on Z axis.
CONST DIK_UP = 0xC8 /* UpArrow on arrow keypad */
CONST DIK_PRIOR = 0xC9 /* PgUp on arrow keypad */
CONST DIK_LEFT = 0xCB /* LeftArrow on arrow keypad */
CONST DIK_RIGHT = 0xCD /* RightArrow on arrow keypad */
CONST DIK_END = 0xCF /* End on arrow keypad */
CONST DIK_DOWN = 0xD0 /* DownArrow on arrow keypad */
CONST DIK_NEXT = 0xD1 /* PgDn on arrow keypad */
CONST DIK_Z =              0x2C
CONST DIK_X =              0x2D
CONST DIK_R =              0x13
CONST DIK_ESCAPE =         0x01

C3DScreen s
C3DCamera c
C3DMesh m
C3DObject scene
C3DLight light

float fadjust,fTarget
'target 60FPS for camera movement
fTarget = 1.0f / /*FPS*/60.0f * 1000.0f
fAdjust = 1.0f
's.CreateFullScreen(800,600,32,false)
s.CreateWindowed(0,0,800,600,@CAPTION|@SIZE,"Mesh example - ESC exits",NULL,false)

c.Create(s)
c.Position(0,0,-700)
c.Orient(0,0,1,0,0,0)
c.SetBackPlane(100000)

s.Clear(RGBA(0,0,0,255))
s.BeginScene(c)
s.RenderText(0,10,"Loading objects...",RGBA(255,255,0,255))
s.RenderScene()

m.LoadSkinnedX(s,GetStartPath() + "MyROOM.x")
m.Rotate(0 * .01745,0,0)
m.Position(-700,-150,10)
m.scale(.8,.8,.8)
m.SetAnimation(0,0,800,MILLISECS())

light.Create(s,LIGHT_POINT,1)
light.Position(0,100,-300)
light.SetAttenuation(0,2/500.0,0)
light.SetSpecular(.5,.5,.5,1)
light.SetAmbient(4,.4,.4,10)

scene.CreateScene(s)
scene.AddChild(light)
scene.AddChild(m)
int fps:fps = 0
int startTime
do
startTime = MILLISECS()
'check for keys and move camera accordingly
IF KeyDown(DIK_UP) then _
c.Move(0.0f,10f * fAdjust)
IF KeyDown(DIK_DOWN) then _
c.Move(0.0f,-10f * fAdjust)
IF KeyDown(DIK_RIGHT) then _
c.Rotate(1*.01745 * fAdjust,0,0)
IF KeyDown(DIK_LEFT) then _
c.Rotate(-1*.01745 * fAdjust,0,0)
IF KeyDown(DIK_Z) then _
c.Rotate(0,0,-1 *.01745 * fAdjust)
IF KeyDown(DIK_X) then _
c.Rotate(0,0,1 *.01745 * fAdjust)
IF KeyDown(DIK_PRIOR) then _
c.Rotate(0,-1 *.01745 * fAdjust,0)
IF KeyDown(DIK_NEXT) then _
c.Rotate(0,1 *.01745 * fAdjust,0)
IF KeyDown(DIK_R) then _
c.LookAt(0,0,10000)

s.Clear(RGBA(0,0,0,255))
s.BeginScene(c)
m.UpdateAnimation(MILLISECS())
scene.Draw()
s.RenderText(0,10,"FPS:"+STR$(fps),RGBA(255,255,0,255))
s.RenderText(0,30,"Use arrow keys to move around",RGBA(255,255,0,255))
fps = s.RenderScene()
fAdjust = (MILLISECS() - startTime) / fTarget
until KeyDown(DIK_ESCAPE)
Scene.Free()
END
Title: Re: Basic 3D Models Screenshot
Post by: Ionic Wind Support Team on June 24, 2008, 04:06:37 PM
You need to be using the latest version to get the 3D docs.

Paul.
Title: Re: Basic 3D Models Screenshot
Post by: Swos2008 on June 24, 2008, 04:15:43 PM
You mean I need update my Ebasic to 1.63?
Title: Re: Basic 3D Models Screenshot
Post by: LarryMc on June 24, 2008, 05:26:48 PM
ALways update.

The 2d/3d use to be separate help files from the EB help file.

Now it is all in the EB Help file.

Larry
Title: Re: Basic 3D Models Screenshot
Post by: Swos2008 on June 24, 2008, 06:06:16 PM
I have update it now and looking good.

I going to UPLOAD the Basic Room Models( later) that I have been making and people can test it....I have try changing the  c.SetBackPlane(1000) to the view go Maxium to see the whole models same as 3D World studio pic.

cheers

Title: Re: Basic 3D Models Screenshot
Post by: Swos2008 on June 25, 2008, 11:11:54 AM
Here the files for people to download it and could anyone help me on camera range please.

http://www.mediafire.com/?nxd0mto9y82

cheers