Script to load image

Next
 From:  track
8571.1 
Hi

Is there a script to load several images ?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
8571.2 In reply to 8571.1 
Max posted about rotating images:
http://moi3d.com/forum/index.php?webtag=MOI&msg=8317.3
- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  track
8571.3 In reply to 8571.2 
I don't see code loading images in this post
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
8571.4 In reply to 8571.3 
True, no image loading. I recalled the post because it dealt with images, and might be helpful if someone were making a load script.

Images.htm and Images.js are the two existing scripts in MoI.

I am not aware of an automatic Image load script.

I think a good question would be what sort of layout or alignment do you require.
Assuming some sort of repetitive task, a couple of examples might be:

1. Up to six images, one each for: Front view, rear view, left view, right view, top view, bottom view.
(Say to trace out images of some model.) (set up as a "cube", or rectangular 3d box.)

2. Several images laid out checkerboard fashion.

So what would the predetermined alignment parameters be?

I do not know if the Batch Processing script would be relevant. Something to study.
http://kyticka.webzdarma.cz/3d/moi/ (near the end)

- Brian

EDITED: 31 Aug by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8571.5 In reply to 8571.1 
Hi track, I think it should be possible to do a scripted load of background images, but like Brian writes above it would also need to decide the placement of the image - what plane it's on and its bottom left and top right corners. How would you want the script to handle those parts?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  track
8571.6 In reply to 8571.5 
I succeeded to place an image in a given position in 3D with the property frame of the image object.
I will look at the script mentioned above
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8571.7 In reply to 8571.6 
Hi track, the function AddImage() in commands\Image.js is how MoI's image command creates new images. But it's a little complicated since all the UI and pointpicker bindings and such are in there as well.

Here's a streamlined example that just uses some fixed parameters:

code:
    var filename = 'c:\\img\\test.jpg';
    var baseframe = moi.vectorMath.createTopFrame();
    var cornerpt = moi.vectorMath.createPoint(20,20,0);

    var factory = moi.command.createFactory( 'backgroundimage' );

    // background image factory has 3 inputs:
    // 0 : String - FileName
    // 1 : CoordinateFrame - Plane that gives orientation of bottom-left corner of image
    // 2 : Point - upper-right corner point.

    factory.setInput( 0, filename );
    factory.setInput( 1, baseframe );
    factory.setInput( 2, cornerpt );

    factory.commit();


Hope that helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Message 8571.8 deleted 1 Sep by BEMFARMER

Previous
 From:  track
8571.9 In reply to 8571.7 
Thanks
It works
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All