Closed Thread Icon

Topic awaiting preservation: 3d Projection, with a twist, for Software Engines only!!! The sequel. Pages that link to <a href="https://ozoneasylum.com/backlink?for=23490" title="Pages that link to Topic awaiting preservation: 3d Projection, with a twist, for Software Engines only!!! The sequel." rel="nofollow" >Topic awaiting preservation: 3d Projection, with a twist, for Software Engines only!!! The sequel.\

 
Author Thread
sonyafterdark
Obsessive-Compulsive (I) Inmate

From: Bucharest, Romania, Eastern Europe
Insane since: Sep 2004

posted posted 09-30-2004 08:01

For those of you developing a 3D engine for games or CAD, in software rendering, or whatever:..
Yet another trick which is not known(I think) by most people:
Consider Xo, Yo and Zo the camera position offsets.


This is how it works:
Let's take Xc, Yo and Zc as the camera postion vars. They store the position of the camera in the scene.
Now, before rotating, add Xo, Yo and Zo to Xc, Yc and Zc respectively.
Now perform all 3 rotations.
Now, from resulting, rotated scene, from each vertex X coord. substract Xo, from each vertex Y coord. substract Yo and so to for the Z's.

The effect you get when modifying the Z offset, for example, is that of puting your camera on the end of a long stick with it's relative length = Z offset, placed on the Z axis, and making all rotations from the other end. It's the same thing as rotating your whole head instead of just your eyes. The opposite is also possible, you can rotate the camera around an object in space, like in Matrix ). But you have 3 adds and 3 substsin the inner rotation loop, which can't be a good thing a good thing. But nothing is free, is there?

It is also a good idea(rather obvious) to categorize your movements in the world in rotations and translations, so if you have a rotation followed by a translation you need not recalculate your rotations, just translate the last rotated scene. Smart, no? Of course it is. :P.(Probably standard practice,maybe not)


Oh, and know this: Software Engines are better, more efficient, smarter, more complex and slower( ) than OpenGl, DD engines. The people that make them are also smarter and harder working than the ones that make the latter :P.

Keep an open mind and a closed skull but don't outlive your happiness.

sonyafterdark
Nervous Wreck (II) Inmate

From: Bucharest, Romania, Eastern Europe
Insane since: Sep 2004

posted posted 09-30-2004 18:14

since nobody's bodering to, i'll write to myself now.
is there anyone out there that started off on 3d by making Mig fighters in quake II level makers (like worldcraft as i did)? the best one i made looked awesome, and it didn't even have a large poly count. tough i will never understand what could possibly turn a sane person to 4 vertex polys apart from being a breeze to design levels. are triangles passe?
too bad my drives went bad a while ago cause of the PC's power source being choked with dust and that was one of the things i lost. still have the snapshots tough. anyone interested?

Keep an open mind and a closed skull but don't outlive your happiness.

Halma
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2004

posted posted 10-04-2004 16:49

So you're saying that you can rotate the camera about any arbitrary point, and not just the camera's center. This also applies to any object..

sonyafterdark
Bipolar (III) Inmate

From: Bucharest, Romania, Eastern Europe
Insane since: Sep 2004

posted posted 10-07-2004 07:36

Yes, kind of. As long as you know the X, Y and Z distances from the camera reference point to that point in space. Rotation will be done around that point at a radius equal to the distance in real space from the original camera position and the point in space referenced by these offsets.

Mind you, just because you're paranoid doesn't mean they're not out to get you!

« BackwardsOnwards »

Show Forum Drop Down Menu