May 04, 2024, 02:29:52 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Basic 3D Models Screenshot

Started by Swos2008, June 22, 2008, 12:40:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Swos2008

Hiya all,

3DWORLD STUDIO


then I load the mesh in Ebasic.

Ebasic Versions


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

cheers

Barney

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

Swos2008

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

Ionic Wind Support Team

You need to be using the latest version to get the 3D docs.

Paul.
Ionic Wind Support Team

Swos2008

You mean I need update my Ebasic to 1.63?

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Swos2008

June 24, 2008, 06:06:16 PM #6 Last Edit: June 24, 2008, 06:29:32 PM by Swos2008
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


Swos2008

Here the files for people to download it and could anyone help me on camera range please.

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

cheers