Useful mxs sdk extension functions

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

REPLY TO THREAD
 
Thread Tools Search this Thread Display Modes
  10 October 2015
random function of the week

Last edited by Klvnk : 11 November 2015 at 06:34 PM.
 
  10 October 2015
this is my version about the same matter:
def_visible_primitive(rescaleMatrix, "rescaleMatrix");
Value* rescaleMatrix_cf(Value** arg_list, int count)
{
	check_arg_count_with_keys(rescaleMatrix, 1, count);
	Matrix3 tm = arg_list[0]->to_matrix3();
	BOOL reset = key_arg_or_default(reset, &false_value)->to_bool();
	if (reset) tm.Orthogonalize();
	tm.NoScale();
	if (is_point3(key_arg(scale)))
	{
		Point3 scl = key_arg(scale)->to_point3();
		tm.PreScale(scl);
	}
	else
	{
		
	}
	return new Matrix3Value(tm);
}

don't worry about empty 'else'. the scale key argument might be not just a point3 value in my case
 
  10 October 2015
also it might be 'in-place' function to save memory on mxsvalue return
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:18 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.