Made some esperiment with matrix but seems not a good idea to use them because tend to distort object shape.JohnWordsworth wrote:I don't know if we have the facility to create our own matrix objects (I've tried the obvious calls, such as mat(), mat44(), mat4() to no avail).
HOWEVER, I have figured out one useful thing with regards to using matrices for setWorldRotation().
This allows you to get the matrix object from the object, change the values (the matrix information looks to be stored where x, y, z, w are each a vector of length 4 - ie. it's a 4x4 matrix).Code: Select all
local m = entity.go:getWorldRotation(); print(m); m.x = vec(1,0,0,0) entity.go:setWorldRotation(m)
Haven't really had much chance to play with this otherwise, but that's the foundation of it.
setWorldRotationAnglesWithOrder [solved]
Re: setWorldRotationAnglesWithOrder
Re: setWorldRotationAnglesWithOrder
That only happens if you compute them incorrectly. See:Granamir wrote:Made some esperiment with matrix but seems not a good idea to use them because tend to distort object shape.
http://en.wikipedia.org/wiki/Transformation_matrix
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: setWorldRotationAnglesWithOrder
Again thank you minmay,minmay wrote:That only happens if you compute them incorrectly. See:Granamir wrote:Made some esperiment with matrix but seems not a good idea to use them because tend to distort object shape.
http://en.wikipedia.org/wiki/Transformation_matrix
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
unfortunatelly my math skills are too low to handle matrix, even if i understood general concept porting it in game is another matter, as for most of people using the editor i guess.
Re: setWorldRotationAnglesWithOrder [solved]
ok i got it
after some days thinking on it i finally understood why euler angles are not so intuitive (except for small angles) and have gimbal lock problem
it depends on differences on how our mind works and euler angles do
in euler angles the object reference system is solida with object so at change on 1 axis the whole sistem change
in our mind after changing 1 angle we reset the object (bringing his reference system back parallel to world system) and then make second change on another axis
so now i'm wondering how difficult and unefficient may be to do the same in a software?
after some days thinking on it i finally understood why euler angles are not so intuitive (except for small angles) and have gimbal lock problem
it depends on differences on how our mind works and euler angles do
in euler angles the object reference system is solida with object so at change on 1 axis the whole sistem change
in our mind after changing 1 angle we reset the object (bringing his reference system back parallel to world system) and then make second change on another axis
so now i'm wondering how difficult and unefficient may be to do the same in a software?