3 Replies - 224 Views - Last Post: 06 December 2012 - 01:47 PM Rate Topic: -----

#1 mitrapatel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-October 10

set camera and roll

Posted 05 December 2012 - 09:16 PM

i am making the 3d image and set the camera.
here is my camera class.


class Camera {

private:
	Point3 eye;
	Vector3 u,v,n;
	double viewAngle, aspect, nearDist, farDist;
	void setModelViewMatrix();

public:
	Camera();
	void set(Point3 eye, Point3 look, Vector3 up);
	void roll(float angle);
	void pitch(float angle);
	void yaw(float angle);
	void slide(float delU, float delV, float delN);
	void setShape(float vAng, float asp, float nearD, float farD);

};


here is set function. but in this set function it shows an error : declaration is incompatible with type eye, look, up which declared in camera.
void Camera :: set(Point3 Eye, Point3 look, Vector3 up)
{
	eye.set(Eye);
	n.set(eye.x - look.x, eye.y - look.y, eye.z - look.z);
	u.set(up.cross(n));
	n.normalize();
	u.normalize();
	v.set(n.cross(u));
	setModelViewMatrix();
}

if any one can help solving this error would be appreciated.

thanks.

This post has been edited by jimblumberg: 06 December 2012 - 12:41 PM
Reason for edit:: Added missing Code Tags, Please learn to use them.


Is This A Good Question/Topic? 0
  • +

Replies To: set camera and roll

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,357
  • Joined: 02-June 10

Re: set camera and roll

Posted 06 December 2012 - 10:47 AM

This isn't graphic design - this belongs in one of the programming forums. Do you even know which language you are writting this in so we can move it?

:code:

Attached Image
Was This Post Helpful? 0
  • +
  • -

#3 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 710
  • View blog
  • Posts: 2,033
  • Joined: 20-March 10

Re: set camera and roll

Posted 06 December 2012 - 12:35 PM

Hi,

You declare


void set(Point3 eye, Point3 look, Vector3 up);

and

implement it as

void Camera :: set(Point3 Eye, Point3 look, Vector3 up)

my guess is you should have declared it as

void set(Point3 Eye, Point3 look, Vector3 up);

as eye is a private Point3 variable

This is the trouble in declarations where one variable looks similar or exactly the same
as each other...

Try not to do it...

Snoopy.
Was This Post Helpful? 0
  • +
  • -

#4 mitrapatel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-October 10

Re: set camera and roll

Posted 06 December 2012 - 01:47 PM

yes i have tried to put void set(Point3 Eye, Point3 look, Vector3 up); in Camera class. but the same error.

N this is openGL for graphics.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1