Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  


An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Water Music

Pages: 1 2 [3] 4 5 6
Hello again Cooldude.  We had such fun with the 3d calc last time, I thought I'd chime in again.  Actually, just wanted to say that if you google "line plane intersection code" you'll a few useful hits.  Easier than me typing it all out, anyway.

I may be a bit old school in terms of my gaming, but because collision detection can be quite computationally expensive there are a couple of tricks that tend to be employed to reduce the number of calculations.

Invisible bounding boxes around objects.  Where each detailed model has an invisible, crude model associated with it that is used for collision detection.  doing precise collision detection on a detailed 10k+ model is far more expensive than for a 500 poly blocky model, so it kinda makes sense.  You see this in games all the time, where you can see a bullet's tracer missing/hitting something very clearly, and the game reacting to it wrong - what you don't see is how the bullet is striking the bounding box.

When shooting through objects games like railings or chain link fences, games will often treat the whole object as a 2 poly collision object and roll randomly to see if the bullet goes through unimpeded.  E.g. the alien robot zombie is behind a metal railing, the bullet goes through railing space, then the enemy space, so at the railing space there is a 10% that the bullet stops. Rather than going through the expensive calculation of detecting the space of each rail individually.

Do an initial calc of which objects are even in the right area/direction and if they're not then don't even bother trying to do collision detection.  Just makes sense, but it does need to be done.

You probably know all of this already, but I thought I'd just add it just in case.  If you are having trouble with your frame count, then proper collision detection can have a pretty significant impact.

General Anim8or Forum / Re: Edge Properties??
« on: August 21, 2012, 01:38:17 am »
Huh, well I poked around with it again.  It seems if I select the edge of a subdivided object and change the edge properties, then nothing seems to change; but if I then move the points, it starts to actually do something.  Interesting.  I still can't see any difference between "smooth" and "creased," but the degree of roundness is having an impact.

Good stuff.  Thanks for the tip.

General Anim8or Forum / Re: Edge Properties??
« on: August 19, 2012, 04:10:57 am »
I've never seen this to actually do anything.  I think the window is there because Steve wanted to set it up for future functionality.  But if it works now, I'm clearly missing something.

General Anim8or Forum / Re: Problems with anim8or on Windows 7 64-bit
« on: June 13, 2012, 12:58:31 am »
I'm using 7-64 and the only problem I get is some artifacting with the selection tool.  Nothing that affects the functionality, so the OS probably isn't the issue.

General Anim8or Forum / Re: daz studio makehuman and anim8or
« on: January 25, 2012, 08:30:53 pm »
I've poked around with it a bit.  It actually has my favourite pose editor, but I haven't found much actual use for it.  Not that I've had any significant progress in any 3d project for a while.  The poly count tends to be outrageous with their models, I think, because of the way that they overuse morphs for customization.  As for cheating, remember the adage:  "Plagiarism is the highest form of flattery."

You're welcome, just make it awesome for me.  You actually can get it all into one formula without an if statement, but it's ugly, unreadable, and probably won't end up saving you any cycles.


edit:  oops, scratch that.  It'll give a DIV0! error along the x-axis

I think that's right, but I haven't done much error checking.  Basically I've included a weird negative/positive if statement into the formula.  But I doubt it works any better on a machine level so I'd keep it the way you have it.

My degree was actually in English (by way of physics) but I'm afraid that the only advice I have to offer on that score is to make a habit of asking your teacher for help on a paper/project before submitting it.  That will always net you a higher grade just because your teacher would rather give you a higher grade rather than admit that they couldn't offer any actual assistance.  Sad but true.  The internet is destroying the English language anyway.

Yes, I think I know what is going on there.  I sort of took the calculation of the yaw for granted as it's pretty straightforward on paper, but in computer speak there are a few cases that you need to take care with.  So I have a new formula for you to try out to get your yaw angle that should take care of everything.  I couldn't get it all into one calculation, but this is the most graceful I could get it:

if dx=0 and dz=0 then
   yaw is unchanged from its last orientation
if dz<0 then

The first part is to take care of situations where the yaw component is non-existent:  straight up, straight down, or not moving.  This will require your keeping track of the last position, or building up functions for special cases.  Movement along the y-axis is problematic, so one way to deal with it is to keep anything from being able to move to an angle which is perfectly perpendicular to the ground -> pitch max of 89 degrees.  Otherwise, if pitch exceeds 90 degrees you'll need to invert the yaw 180 degrees and roll the object around its z-axis 180 to get the pitch below 90 again - if you follow.  Best to just not let them get there.

The second part is the best way to calculate the angle without running the risk of getting a DIV0! error at the x or z axis.

The last part is what takes you from a 180 degree angle to a 360 degree one - except in radians, of course.  I couldn't see a way to integrate it into the other calc, so I think you may have to break it out into an if statement as I have done.

edit:  forgot to mention that this will calculate the angle as increasing while rotating clockwise.  If you want it to increase counter-clockwise then replace dx with -dx in the formula.

Sorry, but as you can probably tell I haven't gotten much forum time lately, and also don't have much time now.  But getting the degree of pitch from a 3d vector is pretty easy so I had to take a second to chime in.

Quick terminology, you have point1 -> (x1, y1, z1) and point2 -> (x2, y2, z2) with the vector between them being (x2-x1, y2-y1, z2-z1) which I'm going to call (dx, dy, dz).  "d" is referring to the greek letter delta which just means ("difference in x", "difference in y", diff z").

The length of a 3d vector is L=sqrt(dx^2 + dy^2 + dz^2).  Then you just make a right angle triangle with the vector as the hypotenuse, and dy as the opposite edge from your pitch angle.  Then you can use 2d trig.

Pitch = sin^-1(dy/L)

or Pitch = sin^-1(dy/sqrt(dx^2 + dy^2 + dz^2))

And if you want to get the Yaw, you then ignore the Y component of the vector completely and sort it out with standard 2d trig.

I hope this helps.  I'll try to check back over the next couple of days to see if you need any clarification.

Without going into too much trig, I can say that your second formula works out to be the same as the one I quoted - with the obvious exceptions that you've scaled it from a normal vector to a vector of length 2.5 and you are using a different base orientation.  That one is just fine and shouldn't be causing you any problems.

In your first set, where you are converting to radians, your rady2 formula is ambiguously parsed.  Depending on how your code is being assembled the value could be (pitch/180)*pi or pitch/(180*pi), so I'd recommend a pair of brackets to be sure - with the first one being correct.  That difference can affect your vector length, so maybe start there and see if it helps.

ps  currently I'm working on a Mongolian helmet, a Lithuanian helmet, and a pair of gauntlets.

Sorry I never got back to you on that, but my idea of a vacation is to lock myself away in a workshop for 2 weeks doing metalwork.

Quick stolen answer:

"If we define pitch=0 as horizontal (z=0) and yaw as counter-clockwise from the x axis, then the direction vector will be

x = cos(yaw)*cos(pitch)
y = sin(yaw)*cos(pitch)
z = sin(pitch)"

And I'll add to that that in 3d math the length of your vector will be L^2=x^2+y^2+z^2 - the 2d equivalent is a^2=b^2+c^2 for right-angle triangles.  So you can use that to convert your vector to a normal vector of length 1 and then multiply for the speed of your object.

If you want to add gravity or wind, etc. then it is a simple matter of adding an acceleration vector to your velocity vector in gradual increments (for example, if you wanted to add a simple gravity vector you would add a vector of 0(x) -9.8m(y) 0(z) every second - breaking it into fractions, of course).

Just keep in mind to keep the speed of your object separate from the frequency of your game loops.  Which is to say that if I am playing 60fps and my friend is playing at 30fps the I shouldn't see rockets flying twice as fast as my friend does - relativistic physics notwithstanding.

I hope this helps :)

PS  Quick correction: I've verified that the stolen formula, above, gives you a vector of length 1 so you won't need correct the length to get a normal vector

I've studied 3d calc and 3d physics a few years back, so I can probably dig up an answer for you, but I think I will need to know more details about what you are trying to do and what numbers you want to end up with.  The problem could be a few things.  Are you using lines or vectors?  Is distance important or just relative orientation?  The world, the camera, and the objects all have their own coordinate system, so which angle is being compared to which?  E.G. "line between camera and its focal point in relation to the world's z-axis."  And of course, a Google search for "angle between two 3d lines/vectors"  will tell you more than I ever could on the subject.

Finished Works and Works in Progress / Re: So I Finally Try "Subdivision"
« on: December 01, 2011, 02:26:15 am »
On a subtle note, when a deer is walking the forward foot slightly leads the motion of the opposite back foot:  forward right foot starts moving, shortly followed by back left, then as back left is landing forward left starts moving.  This gets closer into synch with the front feet moving close to the same time the faster it goes.

My take on the hair would be to take a long rectangle primitive with a number of divisions along the long axis and twist and tweak where necessary.

And a quick debate to Ensoniq5's point about tris: quads look better the smoother you want the image to look; however, since Anim8or doesn't have any creasing functions in its subdivisions (there is a field, but it doesn't seem to do anything) I find I tend to use tris in areas I want creased -> more edges = less smoothness.  Sometimes that is the effect you need for certain areas.

I'm running 7-64bit at home.  Let me know if you want me to test something out for you.

Conventional wisdom states that you should always have the dimensions of your textures be an even power of 2  (2,4,16,32,64,128, etc.) as a computer can apply them faster.  Given the size of the textures that you are using you may find it useful in that regard to use 8192 x 8192 or 16384 x 16384.  Just a thought.

General Anim8or Forum / Re: 3d model to real life prop?
« on: July 03, 2011, 12:17:04 am »
Or you could just go to www [dot] darkwoodarmory [dot] com or www [dot] deltin [dot] it .  Oh, and if you are going to do it by hand (which, being an amateur sword/armour maker myself, I don't really recommend) I'd at least use an angle grinder rather than a jigsaw - they're relatively cheap and would save you an awful lot of time.  Hilts are tricky unless you have some rudimentary welding skill.  Plain crossbars can be fairly easy, but if you are planning any sort of swept hilt then I hope you know a good blacksmith.  Regardless, it is a lot of fun but takes an awful lot of time.  There is reason why I don't have the time to be more involved in 3d animation :).

Pages: 1 2 [3] 4 5 6