Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Max Exporter to Ruby-OpenGL : rotations handled

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
123 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 30, 2011

That was not that hard ! Converting quaternions to classical degrees and implement rotations on the exporter. That way I can rotate as wanted any object, and those modifications will be too on the final OpenGL scene.

If that can help someone, here is my current MaxScript :

clearListener()

for i=1 to objects.count do
(
final_text = ""
if Superclassof objects[i] == Geometryclass then
(
instance = objects[i]
coords = instance.pos
x = coords[1] as string
y = coords[3] as string
z = -coords[2]
z = z as string
angles = instance.rotation as eulerAngles
angle_x = -angles.x
angle_x = angle_x as string
angle_y = angles.y as string
angle_z = -angles.z
angle_z = angle_z as string
final_text = final_text + instance.name + " " + x + " " + y + " " + z + " " + angle_x + " " + angle_y + " " + angle_z
format "%\n" final_text
)
)

which renders a text file with lines like the ones bellow :

obj_computer -2.31652 0.0 -0.467049 0.0 0.0 0.0
toDraw_computer_01 1.75932 1.07251 4.37115 0.0 0.0 -90.0
toDraw_computer_02 6.29113 1.07251 2.6695 0.0 0.0 0.0
toDraw_computer_03 5.42527 1.07251 5.44239 0.0 0.0 0.0

Category:

Gaming

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more