Ask a Question related to Macromedia Director 3D, Design and Development.
-
dsdsdsdsd #1
capturing the view from a second camera
hello;
if I add a new camera to my world how do I capture what it sees;
thanks
dsdsdsdsd
dsdsdsdsd Guest
-
camera.get for an outdoor camera ( not a webcam )
hello; I would like to install an outdoor camera which has its own built-in server; I want the video capture to be delivered to a client-side... -
Capturing a Camera using Flash Communication Server
Dear All, I am developing an aplication on streaming a live video from a WebCam on to a webpage. There are many cameras in the network. But they... -
Camera zooming, general 3D model view interaction
hello i'm working on a viewer for 3D models. the possibilities of interaction are: - zooming by moving RMB - orbiting by moving LMB -... -
multiply camera view-is it possible?
how can i see , on the stage, at the time, two points of view, of two different cameras, moving in the same 3d world? I have some idea that includs... -
openspark #2
Re: capturing the view from a second camera
Look up addCamera() and rect (camera). You must set the rect of an added camera to something other than the default rect(0, 0, 1 ,1)
openspark Guest
-
dsdsdsdsd #3
Re: capturing the view from a second camera
hello openspark; thanks for responding;
I am wondering how I capture what the camera sees;
I have read the manual with respect to the camera, but it does not mention how
to make use of the camera;
any thoughts;
thanks
Shannon Burnett
dsdsdsdsd Guest
-
dsdsdsdsd #4
Re: capturing the view from a second camera
let me explain what I wish to do:
I wish to put a new camera "behind" a mirror (model with shader and texture )
and to show the camera's view on the surface of the mirror;
does this seem reasonable?
thanks
Shannon Burnett
dsdsdsdsd Guest
-
openspark #5
Re: capturing the view from a second camera
Here's a behavior that you can drop on an empty 3D sprite. It creates a cube
in front of the main camera and a sphere behind. It creats a second 'rear-view
mirrir" camera to look backwards, and display the sphere.
on beginSprite(me)
tSprite = sprite(me.spriteNum)
tMember = tSprite.member
tMember.resetWorld()
tCamera = tMember.newCamera("Rear-view mirror")
-- Add to the list of cameras for the sprite
tSprite.addCamera(tCamera, 2)
-- Give the insert a different background color
tCamera.colorBuffer.clearValue = rgb(51, 51, 51)
-- Place insert at center of top of sprite
tCamera.rect = rect(80, 10, 240, 50)
-- Move this camera with the main camera...
tSprite.camera.addChild(tCamera, #preserveParent)
tCamera.rotate(0, 180, 0) -- ... but facing in the reverse direction
-- Create a model in front of the main camera...
tResource = tMember.newModelResource("Box", #box)
tModel = tMember.newModel("Box", tResource) -- at center of world
-- ... and another model behind the main camera
tResource = tMember.newModelResource("Sphere", #sphere)
tModel = tMember.newModel("Sphere", tResource)
tModel.worldPosition = vector(0, 0, 500)
end
Is this the sort of thing that you are trying to do?
To create the effect of a mirror, you should place the mirror camera at the
position where the main camera would appear reflected in the mirror. You
should also change the mirror camera's projectionAngle depending on the
distance the main camera is from the mirror: the closer it is to the mirror,
the wider the angle should be, so that the camera frustrum includes all the
objects that the main camera would see in the mirror.
An interesting project.
openspark Guest
-
necromanthus #6
Re: capturing the view from a second camera
Originally posted by: Shannon Burnett
I wish to put a new camera "behind" a mirror (model with shader and texture )
and to show the camera's view on the surface of the mirror;
does this seem reasonable?
Hi Shannon,
Just create the second camera and tune up its position, rotation and FOV.
Also you have to change the rect of the W3D member (default :
rect(0,0,320,200)) according to your needed texture size (64x64, 128x128, etc).
After that, at runtime, all you have to do is to switch the camera and to
create a new texture #fromCastMember, using the W3D member as source.
At the end, restore the default camera.
But keep in mind: this kind of runtime created textures are frame rate killers
!
So if you need my advice: no mirrors in shockwave !
LOL
necromanthus Guest
-
dsdsdsdsd #7
Re: capturing the view from a second camera
openspark, thanks for your response;
however this is not quite right; imagine that I 'capture' the Rear-view
mirror's view and transfer that view to a texture residing on a model;
necromanthus, thanks for your response also;
I thought that I was correct using
image_object = copypixel( new_camera , (a,b,c,d) , new_camera.rect )
then
my_texture = the_world.newtexture( ... , #fromimageobject , image_object )
any thoughts,
Shannon Burnett
dsdsdsdsd Guest
-
necromanthus #8
Re: capturing the view from a second camera
Originally posted by: Shannon Burnett
necromanthus, thanks for your response also;
I thought that I was correct using
image_object = copypixel( new_camera , (a,b,c,d) , new_camera.rect )
then
my_texture = the_world.newtexture( ... , #fromimageobject , image_object )
Avoid using copyPixels at runtime (because the frame rate is going down
deeply).
The method I gave you works a little bit faster.
But obviously not enough faster for shockwave ...
Anyway, if you really want to emulate a mirror in SW3D (keeping a decent frame
rate), use the algorithm I gave you.
Also, do NOTcreate textures bigger than 64x64 !
If you need badly a higher resolution, use a simple skip few frames routine
and create a new texture after a sequence of (let's say) 5 frames.
Try to do your best.
necromanthus Guest
-
dsdsdsdsd #9
Re: capturing the view from a second camera
necromanthus, thanks again;
unfortunately I am unable to make heads or tails of this;
but I do appreciate your time;
Shannon Burnett
dsdsdsdsd Guest
-
necromanthus #10
Re: capturing the view from a second camera
Originally posted by: Shannon Burnett
necromanthus, thanks again;
unfortunately I am unable to make heads or tails of this
I see ... is not so simple to transpose an algorithm into LINGO, isn't it ?
But because you're a nice person, download and study this example:
[url]http://necromanthus.com/Games/ShockWave/tutorials/Mirror.html[/url]
note: the tricky part is that you don't need the second camera !
necromanthus Guest
-
Dean Utian #11
Re: capturing the view from a second camera
necromanthus wrote:
Nice. Do you intend to keep that page up long term. I've already downloaded the> But because you're a nice person, download and study this example:
> [url]http://necromanthus.com/Games/ShockWave/tutorials/Mirror.html[/url]
> note: the tricky part is that you don't need the second camera !
file for future reference perhaps for my students. Can I link to your site? Will
you be increasing the amount of demos?:)
regards
Dean
Director Lecturer / Consultant
[url]http://www.fbe.unsw.edu.au/learning/director[/url]
[url]http://www.multimediacreative.com.au[/url]
Dean Utian Guest
-
necromanthus #12
Re: capturing the view from a second camera
Originally posted by: Dean Utian
Nice. Do you intend to keep that page up long term. I've already downloaded the
file for future reference perhaps for my students. Can I link to your site?
Will
you be increasing the amount of demos?:)
Hi Dean,
Yes. That's a permanent link (like this one:
[url]http://necromanthus.com/Games/ShockWave/tutorials/PanCamera.html[/url] )
Feel free to link to [url]http://necromanthus.com[/url] (you may use this button:
[url]http://necromanthus.com/Images/necro_88x31.gif[/url] )
As I said some time ago, I intend to open a ShockWave subdomain on my site
(containing many interesting SW examples and tutorials).
But I need a reason to do that.
And here is the reason: Adobe MUST update (and improve) the SW3D engine.
Otherwise, I can't waste my time for nothing.
So ... it's up to Adobe !
p.s.
Someone told me about the increased number of machine guns in australian
schools.
ha ha ha
best regards
necromanthus Guest
-
Michaelcov #13
Re: capturing the view from a second camera
Hi necromanthus.
I am interesting in the mirror script you have uploaded and have attempted to
add it to my game code. I have added an object called mirror but I get the
error message
object expected
for this line
w.newTexture("mir",#fromCastMember,member("3D"))
3D is the name of my 3D sprite.
Have I missed something very obvious lol?
Thanks
Michael
Michaelcov Guest
-
necromanthus #14
Re: capturing the view from a second camera
Originally posted by: Michaelcov
I am interesting in the mirror script you have uploaded and have attempted to
add it to my game code. I have added an object called mirror but I get the
error message
object expected
for this line
w.newTexture("mir",#fromCastMember,member("3D"))
3D is the name of my 3D sprite.
Have I missed something very obvious lol?
Hi Michael,
Don't forget to declare the global 'w' variable in the MovieScript 'init' !
p.s.
But don't waste your time anymore.
As I said before: this kind of runtime created textures are frame rate killers.
This example is for didactical purposes only.
Can't be used in a serious project (containing a bunch of polygons and tons of
LINGO).
cheers
necromanthus Guest
-
Michaelcov #15
Re: capturing the view from a second camera
Ok, I won't try mirrors. Advice taken :)
Michael
Michaelcov Guest



Reply With Quote

