Attaching A Camera To An Object

I'm currently putting together a demonstration of a
user-controlled ball rolling around on a piece of land and I'd
really like the camera to follow the ball from a distance (i.e.
have the camera move along the same axis as the ball is from it's
position in the sky) but am having some trouble doing this. What
terminology or syntax should I use for this, and whereabouts in my
code should it fit?
My code is as follows:
quote:
global w, hk, rb, vPlaneH, rb2
on beginSprite me
createPhysicalObjects()
end
on createPhysicalObjects me
-- ball
m = w.model("Marble")
m.addModifier(#meshdeform)
rb = hk.makeMovableRigidBody(m.name, 100)
rb.restitution = 2
rb.friction = 500
-- ground
m = w.model("Landscape")
m.addModifier(#meshdeform)
rb2 = hk.makeFixedRigidBody(m.name, false)
-- invisible bottom
vPlaneMR = w.newModelResource("ground", #box)
vPlaneMR.height = 10
vPlaneMR.width = 225
vPlaneMR.length = 225
vPFixed = w.newModel("bottom", vPlaneMR)
vPFixed.transform.position = vector (0, 0, -20)
vPFixed.transform.rotation = vector (90, 0, 0)
--vPFixed.visibility = #none
vPFixed.addModifier (#meshDeform)
--vPFixed.visibility = #none
vPFixedH = hk.makeFixedRigidBody ("bottom", true, #box)
hk.gravity = vector (0, 0, -100)
end
on exitFrame me
-- x axis (RED) point left, y axis (GREEN) points towards
the camera and z axis (BLUE) points up
-- Marble Movement
if keyPressed (126) then rb.applyImpulse (vector (-300, 0, 0
else if keyPressed (125) then rb.applyImpulse (vector (300,
0, 0))
else if keyPressed (123) then rb.applyImpulse (vector (0,
300, 0))
else if keyPressed (124) then rb.applyImpulse (vector (0,
-300, 0))
end if
I've managed to transform the camera now into a suitable
position from the Marble.
quote:
w.camera[1].transform.position = vector (-350, -350, 250)
This is the perfect starting viewpoint, though I still cannot
find the right code for attaching it.

I don't have director in front of me to check the syntax, but
try this:
on exitFrame me
-- x axis (RED) point left, y axis (GREEN) points towards the
camera and z axis (BLUE) points up
-- Marble Movement
if keyPressed (126) then rb.applyImpulse (vector (-300, 0, 0
else if keyPressed (125) then rb.applyImpulse (vector (300,
0, 0))
else if keyPressed (123) then rb.applyImpulse (vector (0,
300, 0))
else if keyPressed (124) then rb.applyImpulse (vector (0,
-300, 0))
end if
--Make camera follow ball (although rotation never changes
this way)
ballTransform = m.getWorldTransform()
w.camera[1].transform.position = ballTransform.position
w.camera[1].translate(-350,-350,250,#self)
lookAtPosition = ballTransform.position
w.camera[1].pointAt(lookAtPosition)
end
It should give you a good a start at least....

Similar Messages

  • Attachment list in Services for Object toolbar

    Does anybody know if there is any user exit or BADI that I can use to filter certain file attachments in Attachment list of Services for Object toolbar.
    For example, in transaction XK03 (Vendor display), Services for Object toolbar, you can see the Attachment list and it will display list of pc file attachments, however, we have a requirement to display only those that met certain criteria, is there any BADI or user exit for this?
    Thanks in advance for your help.

    you can use BADI
    GOS_SRV_SELECT
    for this.
    Regards
    Raja

  • Camera Raw / smart object ?

    Using CS3 / CR / Bridge
    Scenario:
    I've shot 500 wedding images, sorted & edited them in Bridge. Now I'll look at each one in camera raw (in Bridge) and make any needed adjustments. I use CR and adjust / sync as many similar files as I can; zipping thru the 500 images quickly and save without opening, then in Bridge > Tools > Photoshop > Image Processor, I use the image processor to process all the 500 images (while I sleep), and save as tiff or psd. I set the CR options to process as a Smart Object. But the files don't process a SO.
    Question:
    Is there a way to process /batch process the 500 images and  have them saved so later when I open them, they open as smart objects. I only fine tune the client "Picks" as they don't order all the 500 images shot. Now if I want to alter the color balance, exposure, etc., I can double click the smart object, go back into camera raw and make any adjustments/ refinements, click OK and it updates the file. This mantain's a higher integrity of the file.
    In CR I know I can check the box "open as a smart object", but that only seems to apply if I immediately open the file (or files) and then save them. It is not practical or feasible to select 500 files, open and save them at one time. If I save the Raw file(s) to open later, (as in my above workflow) then it will not open as a smart object.
    Another way to ask this question:
    Why can't I use the Image Processor in Bridge / CR to process my 500 CR files as Smart Objects?
    When in CR I can set the options to process as a SO, but that only will process the open file(s) in CR as SO. Not practical to process 500 files.
    I checked on the Adobe Exchange but did not find any scripts or actions that would facilitate this.
    Does anyone know if what I'm trying to do is possible and how?
    Thanks,
    JeffN

    In an effort to keep this question / answer current, (this question is on listed on two forums) here is an answer from Jeff Schewe from the Photoshop > Mac forum.
    31. Jul 29, 2010 3:58 PM in response to: Jeff_N
    Re: Camera Raw / smart object ?
    Jeff_N wrote:
    Jeff S
    Any thoughts, suggestions, or can this not be done.
    I'm pretty sure it's a bug....when recording the action in CS5, if you change the Workflow Options to open as a Smart Object, ALL the settings are hardcoded into the recorded Open action step. This is wrong...if you open an image and change the Workflow OPtions but DON'T try to open as a Smart Object, the Open action is recorded correctly–only the Workflow Options are recorded and when processed the files properly retain their individual original settings. So, the act of changing the Workflow Options to make a Smart Object is incorrectly hard coding the settings in.

  • What version of iPhoto.  iPhoto 11 9.4.3 (720.91) -  What version of the Operating System. OSX 10.8.3 -  Detail.  I Attach my camera and the fields where the photos usually show up are empty and at the top of the screen it says all photos from camera are

    What version of iPhoto. iPhoto 11 9.4.3 (720.91)
    What version of the Operating System. OSX 10.8.3
    Detail.  I Attach my camera and the fields where the photos usually show up are empty and at the top of the screen it says all photos from camera are downloaded. But they are not. They can't be.
    I fixed the problem somewhat myself by removing the miniSD and manually inserting it. It did not populate automatically. I had to open iPhoto and then it populated only the most recent photos I had taken which fortunately were the only ones I need. No error messages this seems to be a new occurrence.
    Is there a way to just turn iPhoto off and download my photos to the folder of my own choosing?

    Sure - in the iPhoto prefercences set action when a camera is ocnnected to Image Capture
    LN
    Note - your cute formatting really does not add anything and makes your post hard to read and follow - try straight typing with no cute formatting in the future

  • TS3899 After upgrading to IOS 7, the only options Gmail gives using Safari or mail to attach files are attaching a camera roll file or  draw a scribble. How can I attach a PDF or word doc? I was able to do so using IOS 6.

    After upgrading to IOS 7, the only options Gmail gives using Safari or Mail app to attach a file are attaching a camera roll file or drawing a scribble. How can I attach a document such as a PDF or word file? I used to be able to do so using IOS 6.

    skinb wrote:
    Did  you solve the problem? I am a new iphone user. Mac is less intuitive than wished.
    You posted in the iPad forum instead of the iPhone forum. To get answers to your question, post in the proper forum. See https://discussions.apple.com/welcome
    You tagged onto an older post. If you want an answer to your specific question, you need to create a new post. By creating a new post, you will receive emails when helpers post responses.
     Cheers, Tom

  • External File URL attach to FB03 - document service object

    Hi ;
    My requirement is Scanned copy of hard Vouchers stored in one Windows based External drive.this drives contains yearly ,monthly wise sub folders.
    in that sub folders Scanned Copies stored with voucher numbers. this hard Copy of voucher number Updated in FI Document- document header text file.
    based on Input file name customized program to identify the File from External drive and find the URL of scanned File and attach in FB03- Service for object tool.
    How to achieve this requirement this through SFTP Script . FTP is not using in my System.
    highly appreciate if somebody help me on this..
    Regards
    satish

    Hi Satish,
    You may look into option of writing an ABAP program to scan through the list of files in the share drive and pick up one which matches the selection and then perform upload and attach to FB03.
    Some examples of coding is available in thread http://scn.sap.com/thread/1925928
    Regards,
    Deepak Kori

  • CS5 transform camera raw smart object with mask funniness?

    When I try and trasform a camera raw smart object that has a layer mask, the trasform box is not the size of the image, but is about a quarter of the image and it moves up to the upper left quarter of the image. If I first rasterize the smart object then add a mask it transforms just fine. Or if I rasterize the camera raw smart object, then make it a smart object and add a layer mask it transforms normally. So it appears to be an issue with transforming a camera raw smart object with a layer mask that is the issue. Is this a bug?
    Thanks,
    Steve

    I can't post the image publicly because of NDA, but I will pm you a link to the file. I don't always have this issue in cs5. I even tried opening up the same file in a new document and then made a mask and it transformed just fine. But it also is not limited to just this file, I have had this happen with other images as well.
    Thanks,
    Steve

  • When trying to attach, the camera roll appears.

    WHen trying to attach, the camera roll appears

    If you are talking about the Camera Roll appearing when you attach your iPad 2 to a computer that is normal if there are photos in the Camera Roll. In this case the computer thinks that you have attached a camera.
    Does iTunes not see the iPad?

  • DOBJ.UPDATE_FAILED error while attaching adapters to Users Data Object

    PROBLEM DESCRITPION:-
    The following error occured while trying to attach entity adapters to Users Data Object (com.thortech.xl.dataobj.tcUSR) in Post-Update section.
    Error Message: The security level for this data item indicates that it cannot be updated.
    Update failed.
    Update failed.
    Error Keyword: DOBJ.UPDATE_FAILED
    Description: Update failed.
    Action: E
    Severity: C
    Kindly suggest to fix this issue.

    Resolved the DOBJ.UPDATE_FAILED problem - I modified the dvt_data_level to 0 for dvt_post_update_sequence selective entries.
    Able to attach the custom event handlers to Users Data Object - No more DOBJ.INVALID_UPDATE error!

  • Bug? Camera Raw Smart Object Can't Be Edited

    I have a problem where a raw file placed as a smart object can't be re-edited in CS3. Here's how to replicate the problem:
    1. Open a JPEG or TIFF as a Smart Object (may happen with other file types).
    2. Go to Layer > Smart Objects > New Smart Object via Copy.
    3. Double-click the top smart object and make changes in Adobe Camera Raw.
    You should now be able to hide/show the top layer (the final)
    to see the bottom layer (the original.)
    4. Double-click the top smart object layer to see that it properly opens Camera Raw allowing you to make edits (this works for now but will stop working when we encounter the bug in a moment).
    5. Save the file and close it.
    6. Re-open the file and double-click either of the smart object layers to edit them. Instead of Camera Raw dialog opening, the image in the window changes to the original unedited version. This is a bug and doesn't happen on every image, but it always happens on at least some of my images.
    There have been times when it works, but the next time I open the file it stops working. Some of my files allow editing later without problems. Truly weird. Has anyone else had this problem? Is there a workaround?
    I have applied all updaters, so that means I am using Photoshop CS3 10.0.1 with Camera 4.4.1 on Mac OS 10.5.2. I have also trashed preferences for Photoshop and Adobe Bridge. I've also Purged the Adobe Camera Raw Cache in the Bridge. This happens on both my Mac Pro (3GB RAM) and MacBook Pro (4GB RAM) so it's not just one machine.
    Thanks in advance,
    Dan

    Hi Daniel,
    Stumbled on your post while searching on a similar issue. I'm not sure if I precisely understand yuour problem, but here's my experience when dealing with TIFFs and JPEGs embedded as Smart Objects in CS3...
    If the Smart Object layer contains a TIFF or JPEG that has already been edited and saved in Camera Raw (i.e., the embedded file has Camera Raw XMP metadata in its header), then Photoshop will open the Smart Object's contents in Camera Raw... with one provision. You have to make sure that in your Camera Raw preferences, under "JPEG and TIFF Handling", that both boxes are checked for "Always open JPEG/TIFF files with settings using Camera Raw".
    If those boxes aren't checked, when you try to edit the contents of a Smart Object layer containing a TIFF or JPEG with Camera Raw settings in its header, instead of opening the embedded file for editing, Photoshop seems to simply revert to displaying the layer without the settings applied. I'm unsure whether this is a bug or intended behavior, but it seems to be one of the symptoms you describe.
    On the other hand, if you make a Smart Object layer from a JPEG or TIFF that does not already have Camera Raw settings in its header, Photoshop CS3 will never open that layer's contents in Camera Raw, regardless of what preferences you have checked. Instead, the contents are opened in a separate window as a temporary .psb file. The only way I've found to do Camera Raw editing in these cases is to export the layer, edit the exported file in Raw, and then re-import it via Replace Contents.

  • File attachment problem in Services for object XK03

    In XK03 when i try to create a attachment using Services for object icon it is giving an error message in SAP ECC 6.0 after selecting the file from the folder.
    "Error occurred during import"
    Error occurred during import
    Message no. SO424
    Diagnosis
    An error occured during the import of a file.
    System Response
    The import was not carried out.
    Procedure
    If the document is still open in the application, you need to close it before you carry out a new import.
    This error message may indicate a SAP-GUI problem. The cause could be an error during data conversion, for example. Report the error to your system administrator.
    Does anybody knows about this...
    thanks,
    fractal

    Hello Fractel,
    Are you get rid of this issue?
    We have just implemented some of SAP packs/patches and few users face this issue.
    When I tried the same, I did not face this issue.
    Please suggest.
    Regards,
    JPS

  • How to attach a smartform in BOR object

    Hi,
    I want to know how to attach a z smartform to BOR object? I tried to search out here but not able to have the result.
    Kindly provide the guidelines for it....
    Regards,
    Rickky

    Hi,
    In the BOR object, create a method say display_SF. Now in the ABAP properties for that method give "OTHER" option.
    Now in the BOR object, you can find the program which is used. Inside that program, You need to write the code to fetch the required data (ONLY BASIC REQUIRED DATA WILL BE ENOUGH) and call the smartform by passing all the print parameters and all the required data for that smartform.
    Now inside the smartform, with imported required data, you can write all the logic and data fetch etc for the printouts.
    The following sysntax can be used to fetch the required data into the method and can use to pass the same while calling the smartform.
    SWC_GET_ELEMENT CONTAINER 'Plant' PLANT.
    Regards,
    Harish

  • Attach native data to an object

    Hi to all of you! I have the following problem: I want to create a class where each instance uses a corresponding native data block (for example, a C++ object). The problem is, can I somehow "attach" that native data to the java object so I have it ready in the native methods? Currently I'm storing the address of the object in an integer field of the java class, but that seems like a quick hack to me. I couldn't find anything in the forum or in the tutorial I used. Am I missing something?

    No, you are not missing something.

  • Controlling camera with null object

    Hi all,
    Basically I'm doing a rhythmic typing video but I can't seem to control the camera seen below.
    All tutorials I have seen allow the Null to move the camera but all it seems to be doing is moving the orange box behind it.
    I want to zoom on the word 'THERE'S' and pan across for each word, then zoom out at the end to show the whole line.
    Any ideas?
    Thanks,
    Scott

    Make sure that the camera's parent is a 3D null. Make sure you are looking at the active camera. Make sure the text layers are 3D.
    Your shows the camera parented to a 2D null. You said you have fixed that.
    In your composition it looks like all of the text is in Pre-comps with collapse transformations turned on. If the text in the pre-comps is not 3D then this explains your problem. The pre-comps are 3D layers but, when you turn on collapse transformations any 2D object in the scene becomes 2D. That's how collapse transformations works.

  • Can one attach a line to an object?

    I want to create objects with attached lines, so that when I move the object, one end of the line automatically moves as well. Some of you might know that OmniGraffle does this. Is there a way to do it in Keynote?
    I thought not. But just now I imported an Office document and it included such objects and the functionality works in Keynote. It's a bit rough, though -- I can't copy and paste the arrows, can't detach them or re-attach them, and the lengths change in slightly odd ways when I move the objects. Is this some sort of hidden feature?

    Yes there is a way. Highlight the two objects you want to connect, then click Insert>Connection Line. The connection line created has a midpoint that you can drag sideways to make a curve (no orthogonal lines sorry) and you can move the end point away from the object to leave a gap by clicking the blue connection point and dragging back along the line. Not as full featured as OmniGraffle but it's OK.

Maybe you are looking for

  • Would like to redirect page

    Hi All, First, I'm not a java programmer at all... Okay.. I have this portal with an ExceptionHelper.java file and instead of displaying this page to the user, I'd like to redirect the page to an HTML page, perhaps carrying a variable for the error w

  • Airplay isn't showing up on MacBook Air using WiFi

    Just bought Apple TV for conference room in our office.  Had it hooked up to WiFi, airplay wasn't coming up.  Hooked it up to ethernet and iOS devices got Airplay. The only way to get the MacAir to see it is to change the office system from WiFi to d

  • Saml ecp, azure ad IDP supports?

    does the azure AD IDP support SAML ECP?

  • Export With Preset to X-Rite problem

    Using LR 4; first time using LR at all. I did one "Export With Preset to X-Rite" and it worked. Now, with different lighting, I tried to Export with Preset and it doesn't give me the option for a new name, it just asks if I want to overwrite the exis

  • NoClassDefFoundError after System.exit() is called.

    I have found a strange condition with JDK 1.4.2_05 and could not find a bug which relates to it. I have multiple threads running, when I shutdown, I call all the threads to shutdown and finally in main I call System.exit(0). The strange thing is that