04 April 2007  #31 
random data generator
portfolio
Georg Duemlein
New Zealand

easing equaotations
this is a maxscript version of Robert Penners Easing Equotations for Flash:
maybe this is usefull for somebody http://www.robertpenner.com/ http://www.gizma.com/easing/ 20070508 I found this API documentation: http://livedocs.adobe.com/flash/9.0...ng/Elastic.html and c is the "total change in the animation property". I also recomend the " Tweening chapter of my book" at Robert Penners site. I just started reading it and it explains a lot. Georg __________________
Georg Duemlein Last edited by rdg : 05 May 2007 at 04:33 PM. 
09 September 2007  #32 
New Member
student

Angle between points....
Hey people, lovely math here heheh i'v forgotten most of it heheh.
I'm trying now to get the angle between 2 points. So i looked in the reference. there it says the following : to calculate the angle use the following formula : theAngle = acos(dot (normalize v1) (normalize v2)) So i tried this in max. if i select 0.0.0 and 150.661,150.661,0 i get 45. till now all okey. But if i select 10,10,0 and 150.661,150.661,0 i get 0.0197823 Hmmmmm why? for both two the angle should be 45. but i get different results. Any1 who can shed some light on this ? Many thx in advance! __________________
 http://www.evermotion.org http://www.pixelstudio.nl 
09 September 2007  #33 
Frequenter
portfolio
xiss burg
2D/3D Artist, Programmer
Santo Andre,
Brazil

Very strange to get 0.0197823, you should get 0 since the vectors are pointing in the same direction(the angle between them is 0 ). Maybe its a float point accuracy problem at the normalization(1 inversion, 3 multiplies and one square root) and the acos. But anyway, the formula is correct.

09 September 2007  #34 
Maxscript Generator
portfolio
CGConnect Member
Martijn van Herk
VFX Technical Director
Freelance
Rotterdam,
Netherlands
Join Date: Jun 2002
Posts: 1,139

Originally Posted by pix3l:
So i tried this in max. if i select 0.0.0 and 150.661,150.661,0 i get 45. till now all okey.
But if i select 10,10,0 and 150.661,150.661,0 i get 0.0197823 Hmmmmm why? The normalize function returns a unit vector, meaning that it's length equals 1 unit. Normalizing [0,0,0] will return [1,0,0], so this explains why the result of your first example is 45. Your second example should return 0, but returns 0.0197823 instead because of roundoff errors.
Hope this helps, Martijn 
09 September 2007  #35 
New Member
Guilherme
London,
United Kingdom
Join Date: Mar 2007
Posts: 26

Point Inside a 3D topological space
Nice thread!
Any idea in how to test if a point is inside a ndimensional polyhedron just by coordinates? If one has all the vertexes coordinates of a 3d solid and a point3, how to check if the point3 is inside? cheers Last edited by Guimas : 09 September 2007 at 11:57 AM. 
09 September 2007  #36 
KnowitAll
cg artist
Join Date: Feb 2005
Posts: 302

I don't have the complete solution but some ideas:
First try a fast test : find if the point is completely outside the volume by using the distance. For example: you find the center of the bounding box of the volume and the point which is farthest. If your point is farther then it is not inside the volume. It's obvious but that avoid to apply a complex function each time... After... I'm not sure that is 100% secure but if you use the normal of the faces I think we can have a good approach to do that. For a convex volume, a point is inside a volume if this point is behind of each face of the volume. For each face: + find the vector of the pointplane projection of the face + calculate if the vector have the same direction than the normal of the face + if all vectors have the same direction then your point is inside the convex volume The problem appears when you have a nonconvex volume. For example imagine a form like a "U" (in 3D) If your point is at the center of the U, ok that does work because the point is really outside the volume in itself. ... but if the point is inside of the volume then there are several faces where the normal is in opposite direction of the vector of the pointplane projection. Probably the solution is to divide the concave volume in several convex volumes. After you test for each convex volume if the point is inside or not and you stop as soon as you find a point inside... 
10 October 2007  #37 
KnowitAll
cg artist
Join Date: Feb 2005
Posts: 302

I had another idea.
If the point is inside the volume, you can trace a ray to any direction and you intersect a face. You compare the 2 vectors (your ray and the face normal) and if the sign of the dot product is positive then your point is inside the volume. And that could work for a concave volume 
02 February 2008  #39 
Frequenter
arketip
Bruxelles,
Belgium
Join Date: Nov 2005
Posts: 109

Hello,
I had sent a question rather similar about splines but it seems that it is not possible to find a mathematical solution for a spline and the only solution is to convert your spline into on a certain number of lines or walking the spline with iterations. Here is the thread: http://forums.cgsociety.org/showthr...89&page=5&pp=15 But if somebody can confirm this... 
02 February 2008  #40 
Articulator!!!
portfolio
Mark Tsang
Runner/Tealady/B*tch
London,
United Kingdom
Join Date: Apr 2004
Posts: 1,260

hi arketip,
i also looked for the same thing for a long time  as you say the only thing i found was subdividing by n interations and getting closest to one of these i dont think you can do any other way 
02 February 2008  #41 
Frequenter
arketip
Bruxelles,
Belgium
Join Date: Nov 2005
Posts: 109

triangle intersection
I have another question.
In this thread there is a solution for finding the intersection between a plane and a line. But do you know what is the best calculation for triangle intersection ? I can calculate the intersection of the triangle plane and after calculate if this point is inside the triangle. I would like to find an optimized solution. Maybe with the dot product ? 
02 February 2008  #42 
New Member
minns
penryn,
United Kingdom
Join Date: Feb 2008
Posts: 3

link
try this , arketip, if you can understand it, which i dont entirely
http://local.wasp.uwa.edu.au/~pbour...etry/linefacet/ 
03 March 2008  #43 
Veteran
Christopher Evans
Art Technical Director
Crytek
Frankfurt am Main,
Germany
Join Date: Feb 2002
Posts: 174

Is this correct for the intersection of three planes? I have found some situations where it does not seem to return the proper result (not when parallel)
__________________
Christopher Evans Last edited by Anubis : 03 March 2008 at 07:44 PM. 
04 April 2008  #44 
Expert
portfolio
Artur Leao
CoFounder / Project Manager
You can do it! VFX
Porto,
Portugal
Join Date: Sep 2004
Posts: 1,030

Here's a function for finding the circumcenter of any given triangle.
__________________
Artur Leao  CoFounder / Project Manager You can do it! VFX Porto/Lisbon  Portugal http://www.ycdivfx.com 
04 April 2008  #45 
Frequenter
arketip
Bruxelles,
Belgium
Join Date: Nov 2005
Posts: 109

PlanePlane Intersection
Originally Posted by PrettyPixel:
I think that it is not the easiest solution. If you know a better means...
Here is an improvment of the function for calculating the intersection of 2 planes: pA, nA : first plane, where p is a point and n is the normal of the plane pB, nB : the second plane
This is not checked in the code but if dir=[0,0,0] then the Planes are parallel... 
reply share thread 
«
Previous Thread

Next Thread
»


