| Математика |
pointAtUsage
Description3D command; rotates the referenced object so that its forward direction vector points at a specified world relative position, then it rotates the referenced object to point it’s up direction vector in the direction hinted at by a specified relative vector. The object’s front and up direction vectors are defined by the object’s
Parameters
ExampleThis example points three objects at the model named Mars: the camera named MarsCam, the light named BrightSpot, and the model named BigGun: thisWorldPosn = member("Scene").model("Mars").worldPosition
member("Scene").camera("MarsCam").pointAt(thisWorldPosn)
member("Scene").light("BrightSpot").pointAt(thisWorldPosn)
member("Scene").model("BigGun").pointAt(thisWorldPosn, vector(0,0,45))
If you use non-uniform scaling and a custom
pointAtOrientationUsagemember( Description3D model, light, group and camera property; allows you to get or set how the
referenced object responds to the The object’s front and up directions do not need to be perpendicular to each other, but they should not be parallel to each other. ExampleThis statement displays the object-relative front direction and up direction vectors of the model named bip01: put member("scene").model("bip01").pointAtOrientation
-- [vector(0.0000, 0.0000, 1.0000), vector(0.0000, 1.0000, 0.0000)]
See also
pointOfContactUsagecollisionData.pointOfContact
Description3D The The This property can be tested but not set. ExampleThis example has two parts. The first part is the first line of code, which
registers the member("MyScene").registerForEvent(#collideAny, #explode, 0)
on explode me, collisionData
nmr = member("MyScene").newModelResource("SparkSource", #particle)
nmr.emitter.mode = #burst
nmr.emitter.loop = 0
nmr.emitter.minSpeed = 30
nmr.emitter.maxSpeed = 50
nmr.emitter.direction = vector(0, 0, 1)
nmr.colorRange.start = rgb(0, 0, 255)
nmr.colorRange.end = rgb(255, 0, 0)
nmr.lifetime = 5000
nm = member("MyScene").newModel("SparksModel", nmr)
nm.transform.position = collisionData.pointOfContact
end
See also
|