Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / 3d enviroment and 2d message boards?

Author
Message
pagio
21
Years of Service
User Offline
Joined: 8th Jan 2003
Location: - Please Select -
Posted: 13th Jan 2003 18:04
when i load a 3d object on sceeer nothin else 2d can apear like bitmaps or text?if i disable the backdrop then things apear but problems with 3d objects flickering while moving.i want to make message boards like final fantasy and other rpgs.how?
Dont forget the retro games
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jan 2003 04:38
make object cube 1,10

do
text 10,10,"hello"
box 100,100,110,110
sync
loop


this small snippet demonstrates many things and shows some circumstances not always apparant.

firstly we create a cube in 3d using 3dspace 1 and the size is 10.

DB automatically points the camera at it.
Keep in mind if u added the camera commands before and after the cube creation alters the way the whole structure of the camera will work in regards to sizes etc.

You should really add these lines

sync on
sync rate 0

this basically sets up the sync to the fastest speed but temper your usage here to 30 - 60 frames if u need stability.


position object 1,0,0,0

after u created the cube.

then just before the main do loop

fix the camera up

rem plots the camera high and back so we can see the cube
position camera 0,20,-20

rem points the camera at the cube location
point camera 0,0,0




now our do text sync loop area sets up a loop that goes forever.

the text command used in your main loop is reported to be a little slow at the moment but its ok to use.

if u used print here it would fly off the screen
unless u used it in conjunction with set cursor.


the box command draws the same shape each time at 100,100,to 110,110
this is a 10 x 10 box


as u can see the 2d needs to be in the main loop
so its updated each time.

I hope that helps a bit

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jan 2003 04:40
here is that code in a tidy example after that read for u to try.




Bogboy2000
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 15th Jan 2003 00:47
you could try switching method of display, a techniqu i used in bombers, the text commands are esier to use when the backdrop is on because the update without you clearing the screen and writeing them again, but the 2D doesn't work with the backdrop on.

so you could have a main loop and if you in the game mode you go to one subroutien and have the backdrop on and in the other you go to another subroutien and have the backdrop off

e.g.



We're all just a figment of somebodys imagination

Login to post a reply

Server time is: 2024-05-02 15:59:39
Your offset time is: 2024-05-02 15:59:39