I have a direction vector on which I have to apply some rotation to align it to positive z-axis.
To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan inverse.
I think this is a complex task to do. Also, eventually those are also converted to sin(angle) and cos(angle) in the matrix.
Is there any…
<b>OS News: </b>"The [street-smart] people at MPEG-LA have made sure that from the moment we use a camera or camcorder to shoot an mpeg2 or h.264 video, we owe them royalties, even if the final video distributed was not encoded using their codecs."
it's my first question on stack.
Is it possible to infer length of the half angle vector for specular lighting from N·L and N·V without the whole view and light vectors?
I may be completely off-track, but I have this gut feeling it's possible...
Why? I'm working on a skin shader and I'm already doing one texture lookup with N·L+N·E and one…
The success of any website in the fast competitive world of Internet business depends upon the visibility and the ranking of the website on search engines. It is a well established fact that 95% of web traffic is generated through search engines. Therefore the high rank/visibility is imperative for success. Any website however big or small…
Search engine optimization can be defined as a process of actively optimizing a particular website by constantly looking into its various aspects for the sole purpose of acquiring higher traffic through search engines like Google and Yahoo. Simply put, all of the interrelated elements of a site should be considered. What you sell such as…
I often need to take a bitmap (.png) image, and draw some lines or text on top of it, and possibly export a new, thusly "annotated" image.
I know I can basically do all this in inkscape - but inkscape is a complex program, and it needs almost a minute to start up properly on my PCs.
So I was thinking - is there something like a…
This looks simple but I am confused: The way I create a vector of hundred, say, ints is
std::vector<int> *pVect = new std::vector<int>(100);
However, looking at std::vector's documentation I see that its constructor is of the form
explicit vector ( size_type n, const T& value= T(), const Allocator& =…
I've got a class declared like this:
class Level
{
private:
std::vector<mapObject::MapObject> features;
(...)
};
and in one of its member functions I try to iterate through that vector like this:
vector<mapObject::MapObject::iterator it;
for(it=features.begin(); it<features.end(); it++)
{
…
Hi,
I have a vector of Rect: vector<Rect> myRecVec;
I would like to remove the ones which are overlapping in the vector:
So I have 2 nested loop like this:
vector<Rect>::iterator iter1 = myRecVec.begin();
vector<Rect>::iterator iter2 = myRecVec.begin();
while( iter1 != myRecVec.end() ) {
…
My example is as below. I found out the problem is with "const" in function void test's parameter. I don't know why the compiler does not allow. Could anybody tell me? Thanks.
vector<int> p;
void test(const vector<int> &blah)
{
vector<int>::iterator it;
for (it=blah.begin(); it!=blah.end();…
I have a vector declared as a global variable that I need to be able to reuse. For example, I am reading multiple files of data, parsing the data to create objects that are then stored in a vector.
vector<Object> objVector(100);
void main()
{
while(THERE_ARE_MORE_FILES_TO_READ)
{
// Pseudocode
…
I remember hearing that the following code is not C++ compliant and was hoping someone with much more C++ legalese than me would be able to confirm or deny it.
std::vector<int*> intList;
intList.push_back(new int(2));
intList.push_back(new int(10));
intList.push_back(new int(17));
…
I want to push a 2d vector into a hash table row by row and later search for a row (vector) in the hash table and want to be able to find it. I want to do something like
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main(){
std::set…
I want to convert my archived .flac library to .ogg for daily use.
Using
find ./ -iname '*.flac' -print0 | xargs -0 -n1 oggenc -q6
on the root music folder and then deleting every .flac (having copies of them in archive) seems straight forward, after trying it with one file it…
I'm making an vector/matrix library for Game which utilizes SIMD unit on iPhone (3GS or later).
How can I do this?
I searched about this, now I know several options:
Accelerate framework (BLAS+LAPACK+...) from Apple (iPhone OS 4)
OpenMAX implementation library from ARM
GCC…
I'm trying to sort a Vector in java but my Vector is not a vector of int, it is a vector of objects
the object is:
public MyObject() {
numObj = 0;
price = new Price();
pax = new Pax();
}
so I have a Vector of MyObject and I want to order it by…
I tried this:
....
vector<players*> player;
for (int i = 0; i<10; i++)
{
player.push_back(new players());
}
...
And I wonder if I need to free memory for the vector? If so, how?
I'm implementing an algorithm that involves lots of adding and removing things from sets. In R, this is slow because as far as I know, adding or removing things from a vector is slow, since the entire vector has to be re-allocated. Is there a way do do it more…
I'm trying to sort a Vector in java but my Vector is not a vector of int, it is a vector of objects
the object is :
public MyObject()
{
numObj = 0;
price = new Price();
pax = new Pax();
}
so I have a Vector of MyObject and…
Is that possible? I've seen no method that would generate a plain old C vector or array. I have just NSNumber objects in my array which I need as C vector or array.
What's a reliable way to calculate a 2D normal vector for each edge of a triangle, so that each normal is pointing outwards from the triangle?
To clarify, given any triangle - for each edge (e.g p2-p1), I need to calculate a 2D normal vector pointing away…
We're are trying to get the direction of a projectile but we can't find out how
For example:
[1,1] will go SE
[1,-1] will go NE
[-1,-1] will go NW
and [-1,1] will go SW
we need an equation of some sort that will take the player pos and the mouse pos…
I am reading this wonderful book called "Coders at Work: Reflections on the Craft of Programming" by Peter Seibel and I am at part wherein the conversation is with Joshua Bloch and I found this answer which is an important point for a programmer. The…
I'm using the Bullet 3D physics engine in a iOS application running openGL ES 1.1
Currently I'm accepting info from the gyroscope to allow the user to "look around" a 3d world that follows a bouncing ball (note: it only takes in the yaw to look…