Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
determine if one body obscures another

Subject: determine if one body obscures another

From: m4 Chrennikov

Date: 28 Mar, 2011 16:59:04

Message: 1 of 2

Greetings to all.
For ex I have two rectangular parallelepipeds(they don't penetrate each other), for which centers, verticies and normals are defined. It is necessary for any directions to determine whether one body is in front and obscures another body or not. Direction given by angles of rotation around axes. I can determine the relative position of verticies of one body and planes of another. But how to make a conclusion that one body obscures another, knowing vertices position relative to the facial (to chosen direction) planes of the second?

Subject: determine if one body obscures another

From: Florin

Date: 28 Mar, 2011 18:34:03

Message: 2 of 2

"m4 Chrennikov" <abrek77@gmail.com> wrote in message <imqeoo$h3u$1@fred.mathworks.com>...
> Greetings to all.
> For ex I have two rectangular parallelepipeds(they don't penetrate each other), for which centers, verticies and normals are defined. It is necessary for any directions to determine whether one body is in front and obscures another body or not. Direction given by angles of rotation around axes. I can determine the relative position of verticies of one body and planes of another. But how to make a conclusion that one body obscures another, knowing vertices position relative to the facial (to chosen direction) planes of the second?

Hi,

This is not a Matlab question. You will probably find more help in a gamed dev forum (maybe try nehe.gamedev.net). Also I don't know what you are trying to do but OpenGl might be more appropriate to your problem.

And just and idea : In order for an object to "hide" another one you need a viewing direction. Once you set that light source you could try "sending" rays from your objects towards the source. If one of the ray intersects any objects, that the object that initiated that ray will be obscured. I believe this is call "ray tracing". I'm not sure but I also think is very slow and might not suit your purpose. I imagine that just for determining obscurity you can speed it up, as you don't need any complex computation (reflexion, transparency, diffusion etc. ).

Good luck.
Regards,
Florin

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us