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.

Newcomers DBPro Corner / Help i can walk through the floor of my matrix

Author
Message
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 24th Aug 2004 18:54
How do i stop myself from falling through the floor of my matrix, im in a fps mode and i can walk through it?
Do i need to apply gravity to it or something?

Oli

Oswold is a Billy
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 24th Aug 2004 19:33
well...looking at your code...oh! there isn`t any!, well ... looking at the screenshots...oh!there aren`t any!, well, trying to read your mind....ah! thats better

use the command get ground height to get the height of the matrix at your current position, then add a bit for the height of the player, I always use 1 unit to 1 meter, so I get a feel for the relative size of things, so the command

floor#=get ground height (1,x,z)

will put the height of the floor into the variable floor#, note that it must be a float variable (with a # on the end) because if the terrain has slopes then places on it will be at heights like 1.234 etc, then just position the camera at this height plus the height of the player (1.7 meters to eye in this case)

position camera x,floor#+1.7,z

and no matter how the floor bumps and undulates the camera will remain 1.7 meters above it, hope thats some help.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 24th Aug 2004 20:14
Cheers for that mentor, sorry about the lack of everything.
oh and unless you want to be mentally scared id probably stay out of my mind (heehee)

Thanx again
Oli

Oswold is a Billy
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 25th Aug 2004 05:16
Well i posted all of my code down below, sorry if its a bit long for a little post-
My main problem is, if i use mouselook and look down, then go froward i go through the floor.
THere is probably something stupidly wrong I am doing but anyhoo im a newb.

sync on : hide mouse
sync rate 30
rem make matrix
Make matrix 1,10000,10000,20,20
load image "media\bitmaps\textures\real\floor\ceramc03.bmp",1
prepare matrix texture 1,1,1,1
randomize matrix 1,10
rem make 2nd matrix
Make matrix 2,10000,10000,20,20
load image "media\bitmaps\textures\arcade\floor\grass07.bmp",2
prepare matrix texture 2,2,2,2
randomize matrix 2,20
position matrix 2,10000,10,10
rem setup fog and backdrop
backdrop on
color backdrop RGB(120,120,120)
position camera 10,10,100
fog on
fog color RGB(0,0,0)
fog distance 7000
set camera range 1,10000
DO
rem various controls
If upkey()=1 then move camera 20
If downkey()=1 then move camera -15
rotate camera wrapvalue(camera angle x()+mousemovey()),wrapvalue(camera angle y()+mousemovex()),0

SYNC
LOOP


Cheers for any help
Oli

Oswold is a Billy
French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 25th Aug 2004 05:35
Mentor gives you the solution just before!

My English is not so good I'm just French
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 25th Aug 2004 05:37
Hi french guy I learn french at school, also does mentors solution allow me to use mouselook


Cheers Oli

Oswold is a Billy
French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 25th Aug 2004 05:51 Edited at: 25th Aug 2004 05:53
Yes! The 'Mentor' solution just position the camera above the floor, then you can rotate the camera in any direction!
Put...
floor#=get ground height (1,camera position x(),camera position z())
position camera camera position x(),floor#+1.7,camera position z()

...after the keys test.

J'espère que tu es meilleur en français que je ne le suis en anglais!

My English is not so good I'm just French
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 25th Aug 2004 05:56
1) Cheers for expalining that a bit clearer than mentor.
2) Does the French at the bottem mean you are learning english at school?

Oli

Oswold is a Billy
French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 25th Aug 2004 06:04
I was learning... now I'm 30 years old, so I must work
...ermm

My English is not so good I'm just French
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Aug 2004 06:15
LOL , and there was me thinking I was a model of clarity and conciseness , oh well! time to shamble off and shoot meself then

Mentor.

PC1: P4 3ghz, 1gig mem, 2x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 25th Aug 2004 06:23
R.I.P

My English is not so good I'm just French
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Aug 2004 06:31
BANG! soddit! Missed!

Mentor.

PC1: P4 3ghz, 1gig mem, 2x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 25th Aug 2004 16:58
HeeHee sorry mentor, i suppose you did actually explain what everything meant wich was something French Gui didnt.

Oli

Oswold is a Billy
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 25th Aug 2004 17:10
Um now that I have that problem sorted out, I have come across anouther run (Yay! whoooo! cheers to the newbs!) anyway, I can use mouselook to kind of flip the camera upside down and walk upside down??
Here is my mouselook code.

rotate camera wrapvalue(camera angle x()+mousemovey()),wrapvalue(camera angle y()+mousemovex()),0

Cheers again Oli

Oswold is a Billy

Login to post a reply

Server time is: 2024-11-27 07:45:05
Your offset time is: 2024-11-27 07:45:05