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 / How do I place my Building Object on the Matrix?

Author
Message
Hotshot
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 29th Oct 2002 03:28
Hiya all,

Rem Simple 3D WORLDS with refelection
sync rate 100
hide mouse

landsize=2000

make matrix 1,20000.0,20000.0,25,25
load bitmap "c:\Gfx\floor.bmp",1
get image 1,0,0,256,256
delete bitmap 1
prepare matrix texture 1,1,2,2
ghost matrix on 1
set matrix height 1,12,12,300.0
update matrix 1
autocam off

rem Create blob character to follow
make object sphere 1,100.0
make object sphere 2,100.0

autocam on
backdrop on
color backdrop 0

set ambient light 50

load image "c:\Gfx\clouds.bmp",3

rem Create cloud-cover1
load object "c:\Model_DB\sky.x",52
scale object 52,5000000,5000000,5000000
position object 52,0,550,0
texture object 52,3
ghost object on 52

rem Create cloud-cover2
load object "c:\Model_DB\sky.x",53
scale object 53,5000000,5000000,5000000
position object 53,0,545,0
texture object 53,3
ghost object on 53
scroll object texture 53,0.5,0.2

do
Create_world()
loop


rem This program operates a third person camera
function Create_world()

rem Set variables for character position
x#=500:z#=500

rem Activate manual sync
sync on

rem Begin loop
do
` frames per second
set cursor 10,10:print screen fps()

rem Control skycover
scroll object texture 52,0.001,0.0001
scroll object texture 53,0.002,-0.002

rem Control camera with arrow keys
if upkey()=1 then x#=newxvalue(x#,a#,10) : z#=newzvalue(z#,a#,10)
if downkey()=1 then x#=newxvalue(x#,a#,-10) : z#=newzvalue(z#,a#,-10)
if leftkey()=1 then a#=wrapvalue(a#-10.0)
if rightkey()=1 then a#=wrapvalue(a#+10.0)


rem Update character
y#=get ground height(1,x#,z#)+50.0
position object 1,x#,y#,z#
position object 2,x#,y#-250.5,z#
yrotate object 1,a#


rem Position camera to the back of the character
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+100.0
position camera cx#,cy#,cz#

rem Point camera at object
point camera x#,y#,z#

sync

loop
endfunction

I just want to put some buildings on the matrix but I dont know how....can anyone help me please?

cheer

Hotshot
Crossleo
21
Years of Service
User Offline
Joined: 1st Oct 2002
Location: United States
Posted: 29th Oct 2002 17:20
simple just use the get ground height command.

Crossleo
-------------------------------------
Admin of the Cross entertainment team
Hotshot
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 29th Oct 2002 17:49
Can u show me example please?

cheer

Hotshot

TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 30th Oct 2002 01:58
you could look at the tuturials; the tut. 1 to 25. 10 would tell you. but if you are too lazy to then here it is.

y#= GET GROUND HEIGHT (matrix #,x position,z position)
POSITION OBJECT building,5000,Y#,5000

the get ground height can be a problem with the move object command. you will figure it out when you use them both on the same object.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 30th Oct 2002 04:48
Whooooooooooooo boy! Scale your numbers DOWN a little bit man! Whats your FPS!! 5,000,000 radius for your skysphere! YEESH! Just a suggestions- Id make things a weeeee bit smaller!

Final Fantasy, best series ever made.
Hotshot
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 30th Oct 2002 05:48
73 FPS when I run the program Looking good!

Thank you for helping me

cheer

Hotshot

Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 8th Nov 2002 19:51
The size of objects does not affect the fps. Only the number of polygons affects it.

Login to post a reply

Server time is: 2024-04-19 13:50:16
Your offset time is: 2024-04-19 13:50:16