Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,501 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
HOW: check if model is inside camera-view #166057
11/06/07 05:31
11/06/07 05:31
Joined: Sep 2006
Posts: 106
FairyLand!!!
RruthH Offline OP
Member
RruthH  Offline OP
Member

Joined: Sep 2006
Posts: 106
FairyLand!!!
Hi. again.

Does anyone know how I can check if an entity is seen by the camera?
I need this so I can turn off some dynamic lights not viewed by the camera. W/ that I can have more than 8 dynamic lights. woooo! O_O Thanks all

Re: HOW: check if model is inside camera-view [Re: RruthH] #166058
11/06/07 07:22
11/06/07 07:22
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
check for model presence with c_scan

cheers

Re: HOW: check if model is inside camera-view [Re: tindust] #166059
11/06/07 13:14
11/06/07 13:14
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
rel_for_screen (VECTOR*, VIEW*);
Convert the vector's screen coordinates into xyz-coordinates of the given view. Contrary to vec_for_screen, the view angle and positions is not used in this calculation. Thus the resulting coordinates can be directly used for positioning a view entity. If the result is invalid - outside the screen - the command returns 0, otherwise a nonzero value.

Parameters:
VECTOR* screen position to be converted to 3D.
VIEW* view used for the conversion, must be VISIBLE.

Returns:
0 position is outside the view.
!= 0 position is inside the view


"empty"
Re: HOW: check if model is inside camera-view [Re: flits] #166060
11/06/07 14:49
11/06/07 14:49
Joined: Sep 2006
Posts: 106
FairyLand!!!
RruthH Offline OP
Member
RruthH  Offline OP
Member

Joined: Sep 2006
Posts: 106
FairyLand!!!
@tindust and flits

I tried both of your suggestions. It worked perfectly with my code Thanks for helping me out, I really appreciate it O_O

Re: HOW: check if model is inside camera-view [Re: RruthH] #166061
11/07/07 16:23
11/07/07 16:23
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Here's another solution I found to work pretty well. Since turning the lights off can sometimes cause the lightrange to turn off while still in view, you need to make sure the range isn't visible...


Create a spherical model for your dynamic light. Scale this model to adjust it's range. Then in the code, have the lightrange meet the radius of the model:

Code:

// ACTION: dLight
// Skill1: Red 128
// Skill2: Green 128
// Skill3: Blue 128
ACTION dLight
{
my.invisible = on;
my.passable = on;
my.red = my.skill1;
my.green = my.skill2;
my.blue = my.skill3;
//
wait(1);
c_setMinMax(my);
my.skill10 = (my.max_x - my.min_x)/2;
//
while(my)
{
if (my.clipped)
{my.lightrange = 0;}
else
{my.lightrange = my.skill10;}
//
wait(1);
}
}




EDIT: Might help to make it passable

Last edited by xXxGuitar511; 11/07/07 16:24.

xXxGuitar511
- Programmer
Re: HOW: check if model is inside camera-view [Re: xXxGuitar511] #166062
11/08/07 01:26
11/08/07 01:26
Joined: Sep 2006
Posts: 106
FairyLand!!!
RruthH Offline OP
Member
RruthH  Offline OP
Member

Joined: Sep 2006
Posts: 106
FairyLand!!!
This is....this is...... O_O
Thank you so much xXxGuitar511!!!

This is EXACTLY what I need hehehe

Although setting the 'invisible = on' didn't help (The model didn't emit light). But that's easy to fix.I'll just make it transparent and reset alpha to 0.

Thanks agaiiin!!!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1