A few "getting started" issues for a newbie..

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

A few "getting started" issues for a newbie..

Postby Mark » Fri Mar 06, 2009 1:15 pm

I've downloaded the 2.0 beta. Looking at the tutorials from 1.5. (There are no for 2.0 right?)

So I thought I start with the first one, recreate that spinning earth model.
The tutorials itself builds fine in my VS
I set up a project in VS with the same settings, same .libs, same .cpp and .h

I've done everything up to:
NewtonBodySetMassMatrix (rigidBodyBox, 1.0f, 5.0f, 1.0f, 5.0f);
It builds fine at this points, zero warnings.
Then I try to add the line
dMatrix matrix (dgPitchMatrix(-90.0f * 3.1416f / 180.0f));

But then I get error 'dgPitchMatrix': identifier not found
But I have added dMatrix.h and dMatrix.cpp to the project. Any ideas why these arent included in the building? I tried putting include "dMatrix.h" but that didnt solve it.
Mark
 
Posts: 10
Joined: Fri Mar 06, 2009 10:30 am

Re: A few "getting started" issues for a newbie..

Postby Julio Jerez » Sat Mar 07, 2009 10:06 am

t think dgPitchMatrix is in dMatrix.h
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A few "getting started" issues for a newbie..

Postby Mark » Mon Mar 09, 2009 7:00 pm

Just to follow up on this in case some other newbie will have the same problems.
Didnt know about the math lib, that solved it.
Mark
 
Posts: 10
Joined: Fri Mar 06, 2009 10:30 am

Re: A few "getting started" issues for a newbie..

Postby Mark » Wed Mar 18, 2009 4:49 pm

Now I've runned into this issue again. I suspect its a VS issue?
Created a basic empty console project to test.
Added this to main.cpp
Code: Select all
#include <stdio.h>
#include <stdafx.h>
#include <Newton.h>
int main()
{
   static NewtonWorld* nWorld;
   static NewtonBody* ribidBodyBox;
   NewtonCollision* collision;

   nWorld = NewtonCreate (NULL, NULL);

   collision = NewtonCreateSphere (nWorld, 1, 1, 1, NULL);
   ribidBodyBox = NewtonCreateBody (nWorld, collision);


   NewtonReleaseCollision (nWorld, collision);

   NewtonBodySetMassMatrix (ribidBodyBox, 1.0f, 5.0f, 1.0f, 5.0f);
   dMatrix matrix (dgPitchMatrix(-90.0f * 3.1416f / 180.0f));
  return 0;
}


Under linker dependencies I've added newton.lib and dMath.lib
When building I get error C3861: 'dgPitchMatrix': identifier not found

Both include and lib paths point to Newton 2.0 version.
Attachments
NewtonConsole.zip
(5.53 KiB) Downloaded 162 times
Mark
 
Posts: 10
Joined: Fri Mar 06, 2009 10:30 am

Re: A few "getting started" issues for a newbie..

Postby Julio Jerez » Thu Mar 19, 2009 12:15 am

if you are going use the dmatrix class then you need to include the dmatrix.h and dvector.h files
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A few "getting started" issues for a newbie..

Postby Mark » Thu Mar 19, 2009 5:09 am

All right thanks for clearing that :), I thought those were a part of the math.lib in 2.0

Added those two .h, also added dMatrix.cpp to the project
Still the same error thought. Very confused here, looking at the tutorials from the 1.5 package. There you have added the toolbox stuff and newton.lib. If I do the same to my project and set the same includes I still get this error :?
The attached file above contains the VS project.

Code: Select all
#include <stdio.h>
#include <stdafx.h>
#include <Newton.h>
#include "dmatrix.h"
#include "dvector.h"
int main()
{
   static NewtonWorld* nWorld;
   static NewtonBody* ribidBodyBox;
   NewtonCollision* collision;

   nWorld = NewtonCreate (NULL, NULL);

   collision = NewtonCreateSphere (nWorld, 1, 1, 1, NULL);
   ribidBodyBox = NewtonCreateBody (nWorld, collision);


   NewtonReleaseCollision (nWorld, collision);

   NewtonBodySetMassMatrix (ribidBodyBox, 1.0f, 5.0f, 1.0f, 5.0f);
   dMatrix matrix (dgPitchMatrix(-90.0f * 3.1416f / 180.0f));
  return 0;
}
Mark
 
Posts: 10
Joined: Fri Mar 06, 2009 10:30 am

Re: A few "getting started" issues for a newbie..

Postby Julio Jerez » Thu Mar 19, 2009 9:25 am

you have to set the path in your visual studio project. or you have to copy the file to the same location wher teh oethe files are.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests