[Closed] MXS Viewport
This Thread is phase two of my Interactive bitmaps thread which can be found here.
The difference is than now I'm playing around with 3D elements.
The first demo shows my idea of a real perspective view of a rotating box.
[[img] http://www.halbertism.com/Stuff/MMXSVP/MMXSVP_01.jpg [/img]]( http://www.halbertism.com/Stuff/MMXSVP/MMXSVP_03.ms)
Click on the image above to download the script.
Archive:
Version 0.1
Edit:
Version 0.3 – problem causing it not to work under max9 fixed.
Thanks to kees for pointin it out and for Ofer for solving it.
Wow, you must have passed math class. Your a mad man, but keep on being mad I’m loving this stuff.
I work with you daily and still you always surprise me with something new
Thanks for the replies everyone.
Here is an update, I’ve added a function for subdeviding the faces into small triangles
for the camera effect to work.
Now my ‘draw tri’ function calculates the shading of the face but only draws a wire
frame of the triangle. I have an idia for how to fill up the triangle, I just need time to
write it down…
fyi,
The 0.3 crashes in max8.
’ oldVertArr = deepCopy newVertArr’
I’m guessing deepcopy is not something that exists in max8
I wanted to post a thread about this one, but forgot.
How should I use the ‘copy’ function with an array without getting
“OK” in return, so that I could store the copy in a new variable.
Example code:
(
local var1 = #(1,2,3)
local var2 = copy var1
print var2
-- and the result would be:
OK
-- instead of:
#(1,2,3)
)
Truly inspirational work. 5 stars from me.
Keep them coming.
Cheers,
Light
You cannot, copy Array returns OK. Why? No idea (I remember a thread about it a while ago though)
You can try doing
newArr = for a in oldArr collect copy a
Hey Matan,
You could also use the #noMap flag of the array copy method. I’m not quite sure about the referencing going on when you do that, as described in the help (perhaps Bobo can shed some light on this), but it seems to work fine for what you need:
(
local var1 = #(1,2,3)
local var2 = copy var1 #noMap
format "%; %
" var1 var2
var1 = #(2,2,3)
format "%; %
" var1 var2
)
cheers,
o
I think Copy method returns OK because it just performs a shallow copy.
Light