Skip to content

Maxscript for dynamic projection including planar and spherical projection

Notifications You must be signed in to change notification settings

pegasus1982/maxscript-dynamic-projection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Max Script Requirements

​​Short Pitch:

​​ Write a max script that takes a list of positions in 2d, a target object and a starting position selection by the user as inputs to generate a list of positions in 3d based on a deformation of the 2d positions over the object.

​​

​​Details:

​​The objective of the script would be to take an array of pre-defined positions in 2d space (around 100 dots in a grid-like configuration) and project them over a 3d body to generate a new set of positions in 3d.

​​The process would work similarly to a "project" modifier, but dynamic and interactive.

​​

​​In order for the script to place the array properly, it needs some inputs from the user.

​​

​​Components:

  1. ​​The source file for the 2d array (a CSV file with a Point ID and an X and Y position value)

​​

  1. ​​A selected position placed over the surface. A null object can mark the spot. This selected position corresponds to the midpoint of both the 2d and 3d arrays. This point is also oriented along the normal of the surface.

  2. ​​A radius setting. Essentially configuring the distance between the center and the border of the 2d array.

  3. ​​An orientation setting to define the array rotation.

​​

​​The final "projected" positions should be visible in the view-port and interactive in real time. They can be displayed as null objects for example.

​​The script also needs to handle two arrays simultaneously.

​​Proposed user interface:

Positioning Example

​​The user selects a file that contains the 2d array positions

Positioning Example

​​The user clicks a button on the script to activate the desired array to be placed. (left or right)

Positioning Example

​​The user clicks on the target object. A single click selects the object and sets the center point in the click location.

Positioning Example

​​A null object appears over the surface, alongside with a circle representing the radius parameter and a handle that controls the orientation. An array of nulls are also placed over the surface at the correct projected positions.

​​The user can grab the center null tu adjust the position, and the points move in real time.

Positioning Example

​​The user can grab the handle to rotate the array, and the nulls move in real time.

Positioning Example

​​After the user is done adjusting, they can select the other array and repeat the process.

Positioning Example

Positioning Example

Positioning Example

Positioning Example

​​The script features a radius parameter that affects both arrays simultaniously.

Positioning Example

​​After both arrays are placed, the user can click on the export button to export a list of 3d position.

Positioning Example

​​The output should be a CSV file saved in the same folder as the source array. The name of the file should be the name of the object.

Extended Feature:

Spherical projection.

Current projection is planar. Positioning Example

We need a feature that enables “spherical projection”

Essentially, a circle is created with the center of the array as the center and the position of the point as the radius, the third reference axis is the normal orientation. The point is then placed at the intersection between the circle and the object.

Here is a 2d representation of this: Positioning Example

Here is a representation of a single line of points in 3d Positioning Example

The script needs to create a circle for each point

About

Maxscript for dynamic projection including planar and spherical projection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages