Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
GetRaytracingNormal() gets vector of polygons; behind other polygons on some polygons..
Topic Started: Nov 17 2007, 02:03 AM (132 Views)
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
I set my model to be transparent, now I can easily see that GetRayTracingNormal returns the normal of the second poly GetDistance intersects. How do I get it to return the the vector of the first intersected poly not the second intersected poly? Here is my code:
Step()
dist=GetDistanceToModel(map.id,camera.x+lengthdir_x(camera.strafe,camera.roty),camera.y+lengthdir_y(camera.strafe,camera.roty),camera.z+camera.height,machinegun.rotz+randx,machinegun.roty-90+randy)
if dist<9000 {ray_tracing_normal=GetRayTracingNormal(-1);
global.normalx=GetVector(ray_tracing_normal,1)
global.normaly=GetVector(ray_tracing_normal,2)
global.normalz=GetVector(ray_tracing_normal,3)
ReleaseVector(ray_tracing_normal);
hitx=camera.x+lengthdir_x(camera.strafe,camera.roty)+lengthdir_x(lengthdir_x(dist,machinegun.rotz+randx),machinegun.roty+180+randy)
hity=camera.y+lengthdir_y(camera.strafe,camera.roty)+lengthdir_y(lengthdir_x(dist,machinegun.rotz+randx),machinegun.roty+180+randy)
hitz=camera.z+camera.height+lengthdir_y(dist,machinegun.rotz+randx)
global.z=hitz instance_create(hitx,hity,obj_bullethole)}

I read this in the help file, "If you know how the function GetRayTracingNormal(...) works it should be no problem for you to understand this modification. Whenever the script finds an intersection that's closer than the previous one it updates the ray tracing normal, because the ray tracing norm"...Closer than what?
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply