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 / need a peice of code

Author
Message
Blazer
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 13th Apr 2003 22:48
I need a code that says:

if camera facing-object facing 0 then do something

however it can;t be too specific, no decimiles if your able to do that

thx
As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
Obear
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 14th Apr 2003 01:52 Edited at: 14th Apr 2003 01:58
ONe possible way would be to use a plain object as thin as you can get it and as long as the area of your map.

Have it always prorudeing from the start of the camers point directly outwards fomr the center of the screen (will need to have its x.y.z. and roattions updated in the main loop)

make it invisible and then doa simple object colision, ie if the plain object touches the other object then the camera has got to be pointing at it.

you can use the same device for any object you have in your program as the camera moces around.

ok if that doent make sence think of it this way. Get a long thin straight stick, hold it up to your nose pointing directly away from you, hold it there and as you turn your head the stick always poinst to the center of your vision and anything in the way will get struck by the stick.

I said to use a plain object cos its the object with the least amount of polys, a flat stick if you will

if you want a wider range of touch for the stick so it stikes the object just as it comes into view then maybe a cylinder object would be better and you can changes its diameter to fit the scree/camera area
One possible idea.

Login to post a reply

Server time is: 2026-06-11 17:30:38
Your offset time is: 2026-06-11 17:30:38