Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: 1 ... 3 4 [5] 6 7 ... 20

Author Topic: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)  (Read 254919 times)

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #60 on: January 15, 2012, 02:52:35 pm »

Yea don't worry, my plan is to include a whole Manuel built into this thing, including example projects, example code and full tutorials.

It's just a matter of getting past this ray casting bull crap :P

EDIT: PS water music, damn now I want a pair of gauntlets
« Last Edit: January 15, 2012, 02:57:52 pm by cooldude234 »
Logged
¼

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #61 on: January 15, 2012, 03:19:04 pm »

To continue this raycasting headache...
It turns out that the pitch of the ray, when it goes closer to the right or left issue, was actually not being casued by the projection of the ray (all of that trigonometry stuff I show), but rather is happening when I try to get the angle of the pitch.


double get_angle(float x1,float y1,float x2, float y2)
{
   double angle=0;
if (x1 - x2 != 0)
{
    angle = (atan ((y2 - y1)/(x2 - x1)))*180/PI;
}
   return(angle);   
}

that is my oh so lovely function that is used to get the angles between two points, this is working for the yaw, but it doesn't seem to be working for the pitch *sad face*

This is it in action
rayPitch =  get_angle(start_z,start_y,end_z,  end_y);

So, I got to figure out how to gather the pitch from two points.
JOY!
Logged
¼

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #62 on: January 17, 2012, 01:27:56 am »

with no luck on trying to get a pitch between two 3d vectors,
I would like to know on what kind of tools would people like to have link to anim8or.
I know that importing from anim8or is going to be in, and once I get physic I will make it output a physics simulation as well.
I also got the particle class working with billboarding (have it facing relevant to the camera, or just on a particular axis), so I may as well export particles kinda like what terranim8or ( <- what the hell, Firefox says that's spelled correctly but yet billboarding isn't ??? ) did.

So tools for sure that will be link with anim8or...
-Import from anim8or
-Export recording of scene
     -Including export of particles

and I might figure out a way to manage scenes in anim8or and the new cre8or so that you could add an object in anim8or, in a previously recorded scene, and go back into the new cre8or and rerecord everything, import it back into anim8or, and it would keep the object that you added in anim8or (in other words it would not override things that it doesn't need to, so you don't have to redo crap)

so any other ideas for tools associated between the new cre8or and anim8or?
Logged
¼

cre8orexpert

  • Newbie
  • *
  • Posts: 19
  • "Not enough characters"
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #63 on: January 17, 2012, 08:02:16 am »

Hey dude, here's a tip for your scene export thing: use a timestep and finite state machine.

Explanation:

Use fsm (finite state machine) to record current game status, and use timestep to synchonize it to frames.

Also, here some Opengl tips...

-Always use the vector forms of these methods: glvertex,glColor,glTexCoord and glNormal.
-> gl(Vertex|Color|texCoord|Normal)(2|3|4)(f|i|d)v(array_of_values)

-Use display lists for materials and texture units, using glColorMaterial(face,mode) to reduce function call overload:
->glColorMaterialf(GL_FRONT,GL_AMBIENT), now glColor3f() will affect current material ambient. To enable glColorMaterial use: glEnable(GL_COLOR_MATERIAL).

-Use Vertex buffer objects for animated meshs and terrains, or use interpolation between frames (Lerp or qLerp).

-Keep non-gl code before Opengl code, it speeds Opengl rendering.

-use delta-timing for Syncronism (principally for networked games).
->//Loop beginning
time := glutGet(GLUT_ELAPSED_TIME) //or similar like GetTickCount()
delta := time - delay
delay := time

deltasec := delta/1000 //convert to seconds

playerpos.x += player_velocity.x * (0.5 * deltasec) //moves 0.5 units in x, independent of application speed.

Sleep((1000/frames_per_second)-time) //Frame limiting (obs: it don't work in my Engine)
//Opengl Code

...And that's just some tips (and tricks) to speedup your application. I've attached 2 screens of my 3d Engine.
« Last Edit: January 17, 2012, 08:04:49 am by cre8orexpert »
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #64 on: January 17, 2012, 11:37:42 am »

I've used display lists and the colour materials (I still haven't worked it out for everything but it is working and implemented) but there is one particular part of your statement that I don't think I will ever use, EVER.

Quote
GLUT_ELAPSED_TIME
Nope, no glut here. Besides I already have the equivalent function work out.

but yea, I very much like the display list and such, it can save about 16 milliseconds on my tower for one object, which is a great deal when you are rendering thousands and thousands.

So any other ideas for tools between the new cre8or and anim8r?
Logged
¼

cre8orexpert

  • Newbie
  • *
  • Posts: 19
  • "Not enough characters"
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #65 on: January 17, 2012, 12:14:10 pm »

Sorry, i have no ideas for new tools (Principally for anim8or)  :'(.
Logged

davdud101

  • Hero Member
  • *****
  • Posts: 1067
  • Couldn't ever use Blender or Maya. Anim8or's good.
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #66 on: January 17, 2012, 03:34:47 pm »

Hey there, cre8orexpert. To cooldude234, I'm thinking my ideas are some REALLY tall orders that definetly will have to wait. but...
Soft Body Physics? For cloth, hair, stuff like that? (Or is that something we do manually?)
Perhaps mesh distortion/fragmentation, for things like explosions where objects can actually fly apart at random, of get realistically dented.

I know for a FACT that these things are REALLY big features, not to mention that by no means are they required. What do you think about them?
Logged
?

Water Music

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #67 on: January 17, 2012, 04:22:49 pm »

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.
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #68 on: January 20, 2012, 04:40:10 am »

Right So I got it working, but however it only works on one particular side (the left side relevant to the world), and I was just wonder if in the math there is some way to just make it 360 able (the values of the angles only go from -90 to +90), or would I just have to make a complex if statement and reverse the angles?

And clearly this states that I suck at math :P
Logged
¼

Water Music

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #69 on: January 23, 2012, 08:02:34 pm »

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
else
   yaw=sin^-1(dx/sqrt(dx^2+dz^2))
if dz<0 then
   yaw=(pi/2)-yaw

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.
« Last Edit: January 23, 2012, 08:04:28 pm by Water Music »
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #70 on: January 24, 2012, 09:57:20 pm »

Yea I was just trying to see if I can eliminate another use of an if statement, but however presenting that you are using one, I guess I'll just stick to the one I am using (it may not be noticeable difference in speed, if you eliminate one if statement, but over time you can see a difference).
Thanks music waters, you've help me eliminate one problem.

So since I can't embed useful things into my signature, (there's not even enough space to put a simple smile), I'll have to continue telling you what I am currently working on in the form of a post.
First off, getting angles completely working now, I'm able to do a lot more now.

Also I finally decided to incorporate the very not so hard distance formula (I was really lazy to put it in, but its finally in), so now you can use the function getDistance (pointA, pointB) and it will return a number equaling the distance. This incredibly helped a lot to my surprise, as I now have the basis for dynamic cloth and rope simulation. It's a little glitch however because I haven't incorporated centripetal force yet, but AM WORKING ON IT!
Also I can display things that are in a (proper) distance, unlike before it was just checking if things were in range by a square (which looked terrible).

I also got a efficient cube (environment) reflection done, and a few other cheesy looking reflection that look cool if done properly.

I've been also learning more about simulating physics, I might make my own physic functions, or might use just use bullet for the final thing (cause bullet is still awesome), but I still want to learn more about 3d calculus and other things for my own sake of learning.

To davdud101, somehow I over looked your post and didn't see it, well if you read this far you'll know the basis for cloth and rope physics have started to be implemented, as for other soft body physics why not, making a cube jello-y like is actually a lot simpler than cloth physics, in my opinion that is. It's when it comes to physically contacting a surface and moving or rotating in a realistic manner that become the hard part.
Mess distortion, well I was going to have some why to be able to edit the vertices of an object (still have to figure out how I want to make it call a specific vertex), which then you could create a set of variables (an array of them) to store positions or properties of them, so you could store the colour (damnit Firefox, don't tell me you think colour is spelled wrong) of one vertex, oppose to the whole object.

Because of rope physics being in, inverse kinetics are now a possibility, that is once I get bones in.

Also I have been working on the scripting part of the new cre8or some more. Figured out ways to make it run faster, to call different scripts and more. However I still haven't figured out how to make it possible to be able to create new variables on the fly in a script (I could make it stacked based, but that's the ONE MAJOR THING I HATE ABOUT SCRIPTING LANGUAGES!!! I never want to lean towards the stacked based scripting language EVAR!! <- purposely spelled like that :P

Sorry for the long post, I just needed to tell you whats been done the last week-ish or so time that has passed. Also somehow I am failing school because of my English, but yet I corrected the teacher many many times already. Questioning on how that works.
Logged
¼

Water Music

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #71 on: January 25, 2012, 03:25:14 pm »

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.

Yaw=((dz-|dz|)*pi/4dz)+((-1*((dz-|dz|)/dz))+1)*sin^-1(dx/sqrt(dx^2+dz^2))

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.
« Last Edit: January 25, 2012, 04:01:25 pm by Water Music »
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #72 on: January 25, 2012, 09:05:32 pm »

Quote
The internet is destroying the English language anyway.
          LOL... oops :P

I think the get angle function, that I have now, may just be the best I will ever get it, I might make it better, but for now its definitely good where it stands.

When I get around to it I'll make a screen shot showing off some of this stuff (lot of it has to do with motion, so I might put it in a animated gif format)

I'm thinking of adding in shaders, though that isn't compatible with older hardware, I would have to add in a on/off switch for it. To be able to enable and disable shaders, would allow older hardware to use the fixed function pipeline (if equivalent to the shader), in that case, shaders would have to be considered a addition, rather than a dependence, if not then the game you made with the engine and the new cre8or would have to be considered incompatible with older hardware.
Logged
¼

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #73 on: January 28, 2012, 12:12:46 am »

I could make it stacked based
Sorry, I meant to say Heap based, stacked based shrinks and grows, STACK based is a constant sized chunk of memory just for the application.
« Last Edit: January 31, 2012, 05:08:57 pm by cooldude234 »
Logged
¼

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
« Reply #74 on: January 31, 2012, 06:10:55 pm »

Well I decided to ignore all the crap with trying to make variables work in the scripting part, and decided to stop being lazy and implement fonts already.
So yes I got the basics in for fonts.
FOR NOW, I'm doing what cre8or did, and use texture fonts.

Basically they're just a texture, or an image of the letters and ascii thingies.
Then I take that texture and I take the string (the line of text), and I print out the right letter on the texture, for the right letter in the string of text. I'm printing out each of the letters as an individual sprite on a quad (a square), so that they can be printed to the screen or in the 3d world.

I'm going to make some functions and properties for the text such as colour and things.
I also might make them changeable in the string itself
eg.
this is {color=pink} Red {/color} etc. etc.

I'll make the syntax shorter than that though (also I borrowed it streight from this for, as the [ was just swaped with { :P )


I also want a length property in, so you can make the text continue onto another line once it reaches a maximum length (good for making paragraphs and text boxes)

SCREENSHOTS
Logged
¼
Pages: 1 ... 3 4 [5] 6 7 ... 20