Showing posts with label CG. Show all posts
Showing posts with label CG. Show all posts

Wednesday, March 4, 2009

Camera

One thing about Ogre Cameras that is different from what you may expect is that you should only be using one Camera at a time (for now). That is, we do not create a Camera for viewing one portion of a scene, a second camera for viewing another portion of the scene and then enabling or disabling cameras based on what portion of the scene we want to display. Instead the way to accomplish this is to create SceneNodes which act as "camera holders". These SceneNodes simply sit in the scene and point at what the Camera might want to look at. When it is time to display a portion of the Scene, the Camera simply attaches itself to the appropriate SceneNode.

Tuesday, March 3, 2009

Begin OGRE

After the SDK is installed, add "include" and "bin" directory of the SDK to the Visual Studio's VC++ Directories.

For each project, add "CEGUIBase.lib", "ode.lib", "OgreGUIRenderer.lib", "OgreMain.lib", "OIS.lib" and "ReferenceAppLayer_d.lib" to project's Link menu and Additional Dependencies. (Add all or add only the one you will use in your code.) Moreover, for the first 5 lib files, there is a version for debug: "CEGUIBase_d.lib", "OgreGUIRenderer_d.lib", "OgreMain_d.lib", "OIS_d.lib".

Missing a Configuration File or DLLs

If you try to launch your freshly built application but the program complains of missing DLLs or configuration files (*.cfg), then you probably did not copy them over from the OgreSDK folder. In Visual Studios, when you build your application in release mode, it puts the release executable in the [ProjectFolder]\bin\release folder, and the debug executable in the [ProjectFolder]\bin\debug folder. You must copy all the ".dll" and ".cfg" files over from the OgreSDK into the appropriate folders. That is, copy the files from [OgreSDK]\bin\release to [ProjectFolder]\bin\release and [OgreSDK]\bin\debug to [ProjectFolder]\bin\debug. You will also need to edit the resources.cfg file to point at the correct paths. See the next section for more information on this.

Also something in the "Resources.cfg" configuration file should be changed. However, I just copied the media folder to my project folder.

Cannot Launch the Application in Visual Studio

If you are using Visual Studio or Visual C++ to create the application and are having trouble launching it from the environment, the problem is most likely due to the debugger settings. If you press the play button (or go to the Start Debugging menu item) and you get an exception saying that a configuration file (*.cfg) cannot be found, then the Working Directory has probably not been set.

The exact instructions for fixing this will vary based on whichversion of Visual C++ you are using, so I cannot give you a direct walk through, but the basic steps should be the same. Right click on your project in the solution explorer (not the solution itself) and go to properties. Somewhere in the configuration properties should be options for "Debugging". In the debugging options there should be a field for "Working Directory". This should be set to the location that the executable file for your project is being placed.

If you are having trouble figuring out what to put there, try to mimic the "Command" field which should also be in the debugging options. For example, in Visual C++ 2003, the "Command" field should be something similar to "..\..\bin\$(ConfigurationName)\$(TargetFileName)". For the Working Directory, we need to remove the portion of the command which is the target file name (the executable). In this case, the working directory would be "..\..\bin\$(ConfigurationName)". The exact string you have to put there may vary based on your version of Visual C++ and on your build environment, so be sure to check what the Command field is before doing this. Be sure to change the Working Directory for both the Release and Debug configuration.

In Visual C++ 2005 it will probably be something different entirely. I've found the "..\..\bin\$(ConfigurationName)" directory a good thing to try first, if it still does not work you may have to play with it some, or consult some help from the Ogre forums.

The reason we have to do this is that Ogre expects certain files to be in the same directory as the executable, and without setting the working directory to be a directory with these files in it.

 

SceneNodes keep track of location and orientation for all of the objects attached to it. When you create an Entity, it is not rendered in the scene until you attach it to a SceneNode.In addition a SceneNode is not an object that is displayed on the screen. Only when you create a SceneNode and attach an Entity (or other object) to it is something actually displayed on the screen.

One major concept to note about SceneNodes is that a SceneNode's position is always relative to its parent SceneNode, and each SceneManager contains a root node to which all other SceneNodes are attached.

Sunday, March 1, 2009

Humanoid body model layout

Background

One of the most crucial pieces in the game is the media used to represent the players. This must allow for enough customization for the players to feel that they are in a living world, where they themselves are unique, as well as all of the other character. Therefore we need to have a common standard for all humanoid characters, so that they will all be able to represent the world in a correct way no matter what client they're used in.

Humanoid body model layout

An initial layout of the humanoid characters. The layout should be closely followed for female characters.

Clothing layout

The clothes parts needs to be synced with the body model. As an example, a long sleeved shirt will cover most of the arms, allowing the client to hide the "shoulder" and "elbow" parts (thus saving render ops), whereas a shirt sleeved shirt would require that either the "elbow" or also the "shoulder" part was visible.

  • cloak (over the head)
  • long sleeved shirt
  • shirt sleeved shirt
  • long pants
  • short pants
  • low shoes
  • tall shoes
  • apron
  • cape (this requies some physics simulation (mainly springs) which cal3d (used in Sear) has, though not Ember)

Armor

The armour should mostly be a suppliment to the clothing, i.e. it should be possible to wear a "shin guard" and a "long pants" at the same time. Some armour parts however takes precedence, for example when wearing a chain mail legging, all other pants that might be worn should automatically be hidden. An overview of the armour layout can be seen in the image to the left.

  • breast plate (large plate on the front of the torso)
  • shin guards
  • skirt guards
  • helmet (should this replace any hat or cloak worn? --Erik 00:38, 26 January 2007 (CET))
  • shoulder guards
  • chain mail (works like clothes)

Animations

The animations should correspond directly to actions in mason, in addition to the standard movement animations. The following is a compilation of the current status of the animations available for the humanoid character in Ember, and how they map against the server side actions.

Models

Animation name
Description
Ember name
Server actions
Status

Idle
The character is idle, breathes and perhaps shifts position, cracks the knuckles etc.. This would preferably be a couple of different animations that can be randomly played, to not make it too apparent that they're looping.
humanoid.skeleton: wf_humanoid-idle_*
Idle

Walk forwards
Simple forward walking animation
humanoid.skeleton: wf_humanoid_walk_Clip
Move forwards

Walk backwards
Simple backwards walking animation
Move backwards

Run forwards
Simple forward running animation
humanoid.skeleton: wf_humanoid_walk_Clip
Move forwards with greater speed

Sidestep
Simple side stepping walking animation
Move to the side

Swim
The character swims. For now we'll use the same animation for both idle and movement.
The character is placed in water

Pickup
The character picks something from the ground. The same animation can be used when the character drops something.
humanoid.skeleton: wf_humanoid-pick-up_Clip
Action: pickup, drop

General fidgeting
A general animation that can be used whenever there's no other animation to use for an action
humanoid.skeleton: wf_humanoid-fletching_Clip
Generic action

Chop
The character chops down a tree.
Action: chop

Punch
The character makes an offensive punch
humanoid.skeleton: wf_humanoid-offense_punch_Clip
Action: attack

Swing a sword
The character makes an offensive swing with a sword
Action: attack

Defend
The character defends against an offensive action
Action: defend

Eat
The character eats
Action: eat

Collapse
After being defeated in combat or starving to death, the character should collapse and end up in a collapsed state on the ground.
Action: collapse

Rise
After collapsing in combat, the character gets up again.
Action: ?

Dig
The character digs in the ground.
Action: dig

Delve
The character uses a pickaxe to delve.
Action: delve

Sow
The character uses a trowel to sow a seed in the ground.
Action: sow

 

From: http://wiki.worldforge.org/wiki/Human_model_layout

Thursday, February 26, 2009

Site: H-Anim

A site for humanoid animation. Specifications and so on.

http://h-anim.org/

Skeleton used in Humanoid Animation

To animate the humanoid character, a well defined skeleton is used. Following is the skeleton we studied and used in our work.

The skeleton(using maya joint):

The hierarchy of this skeleton is:

3310626029

The hierarchy also can be seen from following selections in Maya:

3311457258

3310626401

3310626435

The annotated reference skeleton model is:

The one we use is slightly different in the neck area:

3318483724

Monday, February 23, 2009

Computational Geometry Code

This page lists "small" pieces of geometric software available on the Internet. Most of the software is available free of charge. Unless otherwise specified, C or C++ source code is available for all programs. Software libraries and collections and programs that can be run interactively over the web are listed on separate web pages.

Caveat Surfor! I can't make any claims about the usefulness or quality of the programs listed here. I don't have the time or equipment to try them all. If you have experience with any of these programs, either positive or negative, please tell me about it.

The programs on this page are divided into several categories, some of which are divided into further sub-categories. (Eventually, each category will get its own separate web page.) Each program is listed only once, but I've provided cross-links between overlapping categories, and I've tried to arrange similar categories near each other.

Each category also includes links to relevant pages in Nina Amenta's comprehensive Directory of Computational Geometry Software, which I strongly encourage you to visit!

Items marked [NEW!] have been recently added or modified.


Robust low-level primitives

Avoid roundoff and precision errors! Use this code instead of naïve floating point or integer arithmetic.

Combinatorics and discrete math


Geometric optimization


Convex hulls and convex polyhedra

Most convex hull programs will also compute Voronoi diagrams and Delaunay triangulations. (Actually, all of them do, if you look at them the right way.)
Relevant pages from DCGS:
Low-dimensional convex hulls
Arbitrary-dimensional convex hulls
Measure properties
Boolean operations on polyhedra
Interesting and/or pathological polytope data
Miscellaneous

Voronoi diagrams and Delaunay triangulations

See also the implementation page from Christopher Gold's site www.Voronoi.com.
Relevant pages from DCGS:
Voronoi diagrams and Delaunay triangulations of points
Many convex hull programs can also compute Voronoi diagrams and Delaunay triangulations.
Constrained Delaunay triangulations
See also mesh generation and manipulation.
  • Super Delaunay, a commercial fully dynamic constrained Delaunay triangulation package from David Kornmann (description only). Interactive demo versions for Sun Solaris and Linux are available here (binaries and data only). Demo versions for other architectures are available from the author.
  • Dani Lischinski's incremental constrained Delaunay triangulation program CDT.
  • Robert J. Renka's TRIPACK, Collected Algorithms of the ACM #751, computes constrained Delaunay triangulations, convex hulls, polygon areas, nearest neighbors, and shortest paths. (FORTRAN)
Medial axes and Voronoi diagrams of line segments
Miscellaneous

Operations on polygons

Relevant pages from DCGS:
Point location
Boolean operations
Triangulation and quadrangulation
See also the sections on Voronoi diagrams and Delaunay triangulations and mesh generation and manipulation.
Miscellaneous

Mesh generation and manipulation

See also the sections on Delaunay triangulations and geometric modeling.

Geometric modeling

See also the section on mesh generation and manipulation.
Relevant pages from DCGS:
Binary space partition trees
Collision detection
Reconstruction
Simplification

Visibility computation


Visualization tools

You should also look for the thing being visualized! See also my list of programs that can be run over the web.

Other

From: http://compgeom.cs.uiuc.edu/~jeffe/compgeom/code.html#mesh

Web 3D platform

Unity - A good commercial engine. Development only supports MacOS.

http://unity3d.com/

 

Blink 3D

http://www.pelicancrossing.com/index.htm

Commercial. Provides a free version.

 

Emma3D

http://emma3d.sourceforge.net/

Open-source.

Saturday, February 21, 2009

Bezier Curves

Linear Bézier curves

Given points P0 and P1, a linear Bézier curve is simply a straight line between those two points. The curve is given by

\mathbf{B}(t)=\mathbf{P}_0 + t(\mathbf{P}_1-\mathbf{P}_0)=(1-t)\mathbf{P}_0 + t\mathbf{P}_1 \mbox{ , } t \in [0,1]

and is equivalent to linear interpolation.

[edit]Quadratic Bézier curves

A quadratic Bézier curve is the path traced by the function B(t), given points P0, P1, and P2,

\mathbf{B}(t) = (1 - t)^{2}\mathbf{P}_0 + 2(1 - t)t\mathbf{P}_1 + t^{2}\mathbf{P}_2 \mbox{ , } t \in [0,1].

A quadratic Bézier curve is also a parabolic segment.

TrueType fonts use Bézier splines composed of quadratic Bézier curves.

[edit]Cubic Bézier curves

Four points P0, P1, P2 and P3 in the plane or in three-dimensional space define a cubic Bézier curve. The curve starts at P0 going toward P1 and arrives at P3 coming from the direction of P2. Usually, it will not pass through P1 or P2; these points are only there to provide directional information. The distance between P0 and P1 determines "how long" the curve moves into direction P2 before turning towards P3.

The parametric form of the curve is:

\mathbf{B}(t)=(1-t)^3\mathbf{P}_0+3(1-t)^2t\mathbf{P}_1+3(1-t)t^2\mathbf{P}_2+t^3\mathbf{P}_3 \mbox{ , } t \in [0,1].

Modern imaging systems like PostScript, Asymptote and Metafont use Bézier splines composed of cubic Bézier curves for drawing curved shapes.

 

Constructing Bézier curves

[edit]Linear curves

Animation of a linear Bézier curve, t in [0,1]

Animation of a linear Bézier curve, t in [0,1]

The t in the function for a linear Bézier curve can be thought of as describing how farB(t) is from P0 to P1. For example when t=0.25, B(t) is one quarter of the way from pointP0 to P1. As t varies from 0 to 1, B(t) describes a curved line from P0 to P1.

[edit]Quadratic curves

For quadratic Bézier curves one can construct intermediate points Q0 and Q1 such that as t varies from 0 to 1:

  • Point Q0 varies from P0 to P1 and describes a linear Bézier curve.
  • Point Q1 varies from P1 to P2 and describes a linear Bézier curve.
  • Point B(t) varies from Q0 to Q1 and describes a quadratic Bézier curve.

Construction of a quadratic Bézier curve
Animation of a quadratic Bézier curve, t in [0,1]

Construction of a quadratic Bézier curve
Animation of a quadratic Bézier curve, t in [0,1]

[edit]Higher-order curves

For higher-order curves one needs correspondingly more intermediate points. For cubic curves one can construct intermediate points Q0, Q1 & Q2 that describe linear Bézier curves, and points R0 & R1 that describe quadratic Bézier curves:

Construction of a cubic Bézier curve
Animation of a cubic Bézier curve, t in [0,1]

Construction of a cubic Bézier curve
Animation of a cubic Bézier curve, t in [0,1]

For fourth-order curves one can construct intermediate points Q0, Q1, Q2 & Q3 that describe linear Bézier curves, points R0, R1 &R2 that describe quadratic Bézier curves, and points S0 & S1 that describe cubic Bézier curves:

Construction of a quartic Bézier curve
Animation of a quartic Bézier curve, t in [0,1]

Construction of a quartic Bézier curve
Animation of a quartic Bézier curve, t in [0,1]

(See also a construction of a fifth-order Bezier curve.)

 

 

From: http://en.wikipedia.org/wiki/Bézier_curve

Google+