Discussion:
Look at origin in 3D
t***@athenet.net
2007-01-03 15:57:27 UTC
Permalink
I don't understand how to make the camera in the RB3dSpace look at the
Origin (0,0,0). Is there a simple way to do this?
David Grogono
2007-01-04 03:15:10 UTC
Permalink
Hi -

There are a couple of ways to do this and it depends slightly on what
your goal is. One easy way is to start with the camera at the
origin, then pitch, yaw, and roll the camera if desired, and then use
a line something like this:
Rb3DSpace1.Camera.MoveForward -10

If this isn't exactly what you are looking for I'd recommend asking
further questions on the Games mailing list as there are plenty of 3D
experts there.

Best regards, David
Post by t***@athenet.net
I don't understand how to make the camera in the RB3dSpace look at the
Origin (0,0,0). Is there a simple way to do this?
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
Louis G5 Batayte
2007-01-04 03:56:49 UTC
Permalink
I have not used Rb3DSpace yet but I have used OpenGL a lot. What
David describes indicates Rb3DSpace is like other 3D worlds, that is
the camera is always at the origin, in the end. So if an item, 3D
object, was created at its local origin, initially the camera is
inside the object, both at the origin. So to see the item, you have
to move the camera away from the origin, which what David describes.
But since the origin stays with the camera, in effect you are doing
is moving everything, all the objects in the scene, away from the
origin/camera.

Lou
Post by David Grogono
Hi -
There are a couple of ways to do this and it depends slightly on
what your goal is. One easy way is to start with the camera at the
origin, then pitch, yaw, and roll the camera if desired, and then
Rb3DSpace1.Camera.MoveForward -10
If this isn't exactly what you are looking for I'd recommend asking
further questions on the Games mailing list as there are plenty of
3D experts there.
Best regards, David
Post by t***@athenet.net
I don't understand how to make the camera in the RB3dSpace look at the
Origin (0,0,0). Is there a simple way to do this?
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
David Grogono
2007-01-04 19:27:41 UTC
Permalink
Post by Louis G5 Batayte
I have not used Rb3DSpace yet but I have used OpenGL a lot. What
David describes indicates Rb3DSpace is like other 3D worlds, that
is the camera is always at the origin, in the end. So if an item,
3D object, was created at its local origin, initially the camera is
inside the object, both at the origin. So to see the item, you have
to move the camera away from the origin, which what David
describes. But since the origin stays with the camera, in effect
you are doing is moving everything, all the objects in the scene,
away from the origin/camera.
Just to clarify. With RB3D, moving the camera to a new location does
not move the origin. If you have an object and the camera at 0,0,0
then moving the camera to 100,100,100 will leave the object at 0,0,0.

- David
Lars Jensen
2007-01-04 07:49:31 UTC
Permalink
Post by t***@athenet.net
I don't understand how to make the camera in the RB3dSpace look at the
Origin (0,0,0). Is there a simple way to do this?
There sure is:

RB3DSpace1.camera.position.z = 700 // back up so we can see the origin

Here are some more 3D basics, including Joe Strout's essential 3D FAQ:

http://ljensen.com/rb/3d_readme_framed.htm

This FAQ contains, among other things, a routine to aim your camera at
any particular point in space, which is something you'll probably be
wanting soon enough...

lj
t***@athenet.net
2007-01-04 15:48:21 UTC
Permalink
Actually, this is more of what I wanted: The user can move the camera
around my object in a circle but it always views in the same direction. I
want the camera to always be facing the object which happens to be at the
origin. The radius of the circle is 750.

This is the code for the camera movement:
Zangle=Zangle+.1
Rb3DSpace1.Camera.Position.X=Rb3DSpace1.Camera.Position.X//this line
is not strictly necessary buy I keep it here for consistency
Rb3DSpace1.Camera.Position.Y=(750*(Sin(Zangle)))
Rb3DSpace1.Camera.Position.Z=(750*(Cos(Zangle)))

After that I want the camera to point towards the origin.
Post by Lars Jensen
Post by t***@athenet.net
I don't understand how to make the camera in the RB3dSpace look at the
Origin (0,0,0). Is there a simple way to do this?
RB3DSpace1.camera.position.z = 700 // back up so we can see the origin
http://ljensen.com/rb/3d_readme_framed.htm
This FAQ contains, among other things, a routine to aim your camera at
any particular point in space, which is something you'll probably be
wanting soon enough...
lj
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
David Grogono
2007-01-04 19:32:14 UTC
Permalink
Post by t***@athenet.net
Actually, this is more of what I wanted: The user can move the camera
around my object in a circle but it always views in the same
direction. I
want the camera to always be facing the object which happens to be at the
origin. The radius of the circle is 750.
Zangle=Zangle+.1
Rb3DSpace1.Camera.Position.X=Rb3DSpace1.Camera.Position.X//this line
is not strictly necessary buy I keep it here for consistency
Rb3DSpace1.Camera.Position.Y=(750*(Sin(Zangle)))
Rb3DSpace1.Camera.Position.Z=(750*(Cos(Zangle)))
After that I want the camera to point towards the origin.
Add these lines and this will point the camera at the origin.

Rb3DSpace1.Camera.Orientation = new Quaternion
Rb3DSpace1.Camera.Pitch 3.14-Zangle

If you need more details, I'd again recommend the games list as
you'll likely get quicker answers there. Also, the link that Lars
pointed you to would be quite helpful.

- David
Lars Jensen
2007-01-05 08:02:01 UTC
Permalink
...indicates Rb3DSpace is like other 3D worlds, that is
the camera is always at the origin, in the end.
No, in RB3D the camera is not always at the origin. It can be moved
and rotated independent of the origin like any other object.

lj

Loading...