OSL ‐ 3d - Mistium/Origin-OS GitHub Wiki

Osl 3d does not require the user to be in fullscreen for it to run however it is much more limited and has issues, if you want textures and more power in your 3d games or projects consider using OSL 3dr

Commands

This allows you to change the positioning of the camera and edit camera settings

// Camera Commands

3d "camera" "position" vector3

3d "camera" "rotation" vector3

3d "camera" "fov" number

Methods

Create a Vector

log dimensions.newVector()

// Make a new vector2

log 2.newVector()

// Make a new vector3

log 3.newVector()

Project vector3 to 2d

[vector3].vproject("camera")
// this returns an array of an [x,y] of the vector3 projected to 2d from the camera

Rotating Vectors

[vector2].vrotate(xpos,ypos,degrees)
// this rotates [x,y] in the [vector2] around [xpos,ypos] by degrees, then returns a new position in the format [x,y]

[vector3].vrotate(xpos,ypos,zpos,yaw,pitch,roll)
// this rotates [x,y,z] in the [vector3] around [xpos,ypos,zpos] by [yaw,pitch,roll], then returns a new position in the format [x,y,z]

Find Magnitude of Vector

[vector2].vmagnitude

[vector3].vmagnitude

Find Distance Between Vectors

log [vector2].dist(vector2)
// calculates the distance between the [x,y] in the first [vector2] and the [x,y] in the second [vector2]

[vector3].dist(vector3)
// calculates the distance between the [x,y,z] in the first [vector3] and the [x,y,z] in the second [vector3]