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
2 registered members (alibaba, vicknick), 1,492 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
Stencil shadow problem with PE map entities #41394
02/23/05 01:18
02/23/05 01:18
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline OP
Member
Jason Bryant  Offline OP
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
Stencil shadows are not displaying correctly on physics-enabled map entities. They show for a split second upon level load, but then immediately disappear. (If I comment out the 'sleep(2)' in the action shown below, the shadow does not show at all. The shadow disappears when the map entitiy is defined as a physics object.)

I have uploaded an example
that demonstrates the problem. The example contains two cylinder models that are casting stencil shadows onto a physics-enabled map entity and the other onto a physics-enabled model. The stencil shadows do not show up on the map entity (The marble block on the left). The stencil shadows show up correctly on the .mdl entity (the wood crate on the right). Both crates have the same action assigned to them. (The example has been updated to include the .wmp files.)

This is the code used in the example:

Code:

//defines
DEFINE mass,skill1;
DEFINE friction,skill2;
DEFINE damping,skill3;

//global vars
var d3d_nobsp = on;
var video_mode = 8;
var video_depth = 32; //16 bit color
var video_screen = 1; //full screen
var d3d_alphadepth=32;
var d3d_shadowdepth=24;
var d3d_lightres=on;

var clip_size=0;
var turb_speed = .1;
var shadow_range = 50;
var shadow_stencil=on;

var cam_dist = 500; //camera distance from the origin

//physics globals
var gravity[3] = 0,0,-1000;


function main()
{

camera.clip_near = 15;
camera.clip_far = 100000;

level_load("stencil_test.wmb");
sleep(1);

//initialize physics
ph_setgravity(gravity);
ph_setcorrections(40000,0.001);

camera.tilt=-45;
camera.pan = 165;
camera.x = 150;
camera.y = 150;
camera.z = 400;

while(1)
{

camera.pan-=mouse_force.x;
//camera.tilt+=mouse_force.y;

//camera.x=cos(camera.pan)*(cam_dist*cos(camera.tilt));
//camera.y=sin(camera.pan)*(cam_dist*cos(camera.tilt));

//vec_to_angle(camera.pan,nullvector);
wait(1);
}
}


//uses mass,mass,Obstacle_damping
action Pushable_block
{
if (my.mass<1){my.mass=10;}
if (my.friction<1){my.friction=50;}
if (my.damping<1){my.damping=90;}
sleep(2);
my.shadow = on;
phent_settype(my,PH_RIGID,PH_BOX);
phent_setgroup(my,1);
phent_setmass(my,my.mass,PH_BOX);
phent_setfriction(my,my.friction);
phent_setelasticity(my,10,10);
phent_setdamping(my,my.damping,my.damping);

}




Gamestudio Pro 6.31.3



Jason

Re: Stencil shadow problem with PE map entities [Re: Jason Bryant] #41395
02/23/05 02:33
02/23/05 02:33
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Shadows have nothing to do with physics.

WMB entities can not cast shadows, only models can. So, remove the 'my.shadow = on' from your WMB entity action. I guess that will fix your problem.


Moderated by  HeelX, Spirit 

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