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
What is the most effecient way to retrieve; collisions from an exoskeletal model?
Topic Started: Nov 17 2007, 05:06 PM (137 Views)
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
I have a unique problem with this .X file I am using. You see, the x file has correct lighting normals, however, the GetRayTracingNormal function returns the last intersected polygon from it, not the first intersected poly like it should. On the other hand, I have the same map in MS3d format, and although the lighting normals are incorrect (and not correctable), GetRayTracingNormal performs like it should. Now you see the problem we are facing. How to efficiently render the .X file, and, at the same time, retrieve collisions from the ms3d model. I have thought of several ways of accomplishing this. The first method I have devised, which works perfectly but drops FPS by as much as 70%, is creating a primitive object from the model and setting the material to be completely transparent, texture: -1. So I thought, instead of using the original ms3d model, why not convert it to a (much smaller using LodChain) U3d File? Of course the most logical solution never works. Ultimate3d returned an "unexpected error" when it tried to save the u3d file. I tried U3d studio, and, as always, froze permanently while trying to load the 6,400 polygon mesh. So, I thought, I guess the .X file converted to primitives should work. Of course, as fate would have it, it successfully exported as U3d, but (inevitably) the primitives retained its messed up collisions. So, I here present you, a third method. Having the collision object in another room and a ghost collision node object to retrieve the collision data from that room, while not wasting any graphics power to render the room. Since this method is not in the Ultimate3d Help File, I need someone here to help walk me through it. If there are other methods of accomplishing this, I would like to hear those as well.
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
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Code:
 
global.invi_room = 135;


Create Event
Code:
 
file = 'models\impossible.x';
LoadMesh ( );
file_2 = 'models\impossible.ms3d';
password = '';
collision_index = external_call ( global.u3d_load_mesh, file_2, password );
external_call ( global.u3d_set_object_room, u3d_type, collision_index, global.invi_room );


Step Event
Code:
 

Step ( );
Step2 ( collision_index );


Step2 ( )
Code:
 

if (u3d_type==1)
   {
   if (textureprevious != texture
    ||xprevious2 != x
    ||yprevious2 != y
    ||zprevious != z
    ||rotxprevious != rotx
    ||rotyprevious != roty
    ||rotzprevious != rotz
    ||scalxprevious != scalx
    ||scalyprevious != scaly
    ||scalzprevious != scalz)
       {
       external_call (global.u3d_model_step,argument0,x,y,z,rotx,roty,rotz,scalx,scaly,scalz,texture);
       textureprevious = texture;
       xprevious2 = x;
       yprevious2 = y;
       zprevious = z;
       rotxprevious = rotx;
       rotyprevious = roty;
       rotzprevious = rotz;
       scalxprevious = scalx;
       scalyprevious = scaly;
       scalzprevious = scalz;
   }
   if (frameprevious != frame
    ||first_frameprevious != first_frame
    ||last_frameprevious != last_frame)
       {
       external_call (global.u3d_model_set_frame,argument0,frame,first_frame,last_frame);
       frameprevious = frame;
       first_frameprevious = first_frame;
       last_frameprevious = last_frame;
   }
}



GetDistanceToCollisionIndex ( )
Code:
 

return external_call (global.u3d_get_distance_to_model,argument0.collision_index,argument1,argument2,argument3,argument4,argument5);


That may work, it most likely won't. I just came up with this off the top of my head.

EDIT:
I forgot to mention that the Doctor doesn't approve of using external_call. If you get too into it, it can get a bit confusing.
Blog|EHS
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Hmmm...I can't say that I'm not a bit lost with understanding your code...basically, can you get collision data from another room, and can you send data to another room (the player and bullets x,y,z,rotx,roty)? Is that possible with U3d? Sorry about your code, its just that its comlpexity, and your underconfidence with its ability to function within desired parameters, kinda makes me not really want to start another "guess and check" session that may last for weeks...I'm not really sure where to put the code either.
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
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
FACT: Rooms don't affect the collision and ray tracing functions.
FACT: I use the same technique in my game for bounding boxes.
UNKNOWN: The code I gave you works.
FACT: It works for me.
Blog|EHS
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply