Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Pointing the face of a plain

Author
Message
Relativity
20
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 17th Aug 2005 00:59
I'm trying to point the face of a plain at the camera. I've tried Point Object but it doesn't quite give me the effect I want. Does anyone know how to do this simply? It can't involve too many maths because I have to do this with several plains. Thanks in advance.

This is a test. This is only a test. If this were an actual emergency you'd all be dead.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 17th Aug 2005 01:53 Edited at: 17th Aug 2005 01:53
well, say you wanted to point something like a tree at the camera, it would be a good idea that it didn't rotate round the x or z axis, so... try this



Relativity
20
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 17th Aug 2005 05:32
Thanks Zotoaster. Works wonderfully.

This is a test. This is only a test. If this were an actual emergency you'd all be dead.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Aug 2005 16:11 Edited at: 17th Aug 2005 16:16
Even though this solution fixed the problem, it does not point an object at the camera. If anyone does want to do this and doesn't know how it's done, use this:

POINT OBJECT ObjNum, Camera Position X(), Camera Position Y(), Camera Position Z()

TDK_Man

NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 17th Aug 2005 21:20
TDK,

Through my experimentation, if one wants to point a plain at the camera, maybe to create the effect of a star, it does not work properly. When going above the object, it will not follow the camera upwards correctly. It is hard to explain, so test it out. Make a plain with some image on it, and point it at the camera alway. Then, go above and past it, as to go behind it.


+NanoBrain+
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 17th Aug 2005 21:35
TDK,

yeah, i know it doesnt point an object at the camera, though if you wanted to make a tree or something you wouldn't point it towards the camera,

unless you did something like

poin object Objnum, camera position x(),object position y(objnum), camera position z()

alternatively you can just rotate it by the camera's angle


TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Aug 2005 03:28
NanoBrain

Will do. I've been rather a lot of it just recently (with my Particle Generator) and I think it has a lot to do with when you use the command.

Zotoaster:

Trees are odd as it depends how you create them. I wouldn't rotate my trees or they would look rather silly. Use a single plain then you have to rotate it towards the camera or it would disappear!

If you rotate the plain by the same angle as the camera, when you look away from it, it would also disappear.

Here are my old trees...

http://www.computechtenerife.com/treetest.rar

But this was done a long time ago before I discovered skyboxes, so don't laugh at my sky and clouds OK?...

TDK_Man

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Aug 2005 15:56
@TDK

not really, if you look at some trees in games, e.g. super mario 64, even though the trees look like a bunch of spheres, they are actually rotating plains


TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Aug 2005 19:28
Zotoaster:

I think you misunderstood me.

I'm not saying you should never rotate the plains for trees. Neither am I saying that you should always rotate the plains.

I'm just saying that in the case of trees (and many other objects created with plains), whether you rotate the plains to the camera or not depends on how you make the object.

If a textured object is made from a single plain, it has width and height but no depth. Viewing it from the side makes it invisible, so you rotate it to the camera.

However, when I make trees, I use two plains (as shown in the link to the tree demo in my last post).

I was just saying that in that case, you wouldn't rotate the plains as it would look like the tree was spinning.

TDK_Man

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Aug 2005 11:58
ah, yes i see, that method does sound better, and looks better on the tank demo.. even better if you make lots of plains


Login to post a reply

Server time is: 2025-05-22 22:04:37
Your offset time is: 2025-05-22 22:04:37