PDA

View Full Version : Sound plugin : knowing where is the current view


sOuSiX
01-05-2009, 08:48 PM
Hello,

I am just making a plugin to manage differents sources of sound in a scene. I have already drawing a 3d object representing a sound. I am also using the FMOD library to play sound.
The object representing the sound is like that : clik here (http://sousix.defrag.fr/images/soundObject.jpg)
When the current camera enter in the object (enter into the sphere) the sound need to be listened, else the sound is not listened.

My question is : How can i know if the current camera/view is inside a sphere? How kind of event can i use to know if the camera is moving or not and getting the position of the camera/view?

Scuse me if it is questions of newbies.
Scuse me for my english.

Thx a lot if you answer.

SoLiTuDe
01-06-2009, 05:58 AM
Look up activeViewport in the maxscript help file, and you can get the current viewport / get current camera / current position... etc. I would suggest forcing use of a camera just to make things easier. You can then test the distance between the camera and your sound object using some basic math functions in max. For example,
distance $camera.pos $soundobject.pos
That's under Point3 Values :thumbsup:

Good luck!

CGTalk Moderation
01-06-2009, 05:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.