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.

Author
Message
Blazer
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 25th Mar 2003 02:20
can somone give me an explination on how to get ground height for 4 diffrenet parts of an object so it works like a car. I've looked through the tank demo but I can't make heads or tails of it.
As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Mar 2003 02:51
make 4 objects

connect these to the main body via limbs or math based positions.

detect the ground height for each cube, translate that to the body cube.






Blazer
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 27th Mar 2003 05:14
took me a while but I figured it out, thanks

As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
Nobody
23
Years of Service
User Offline
Joined: 28th Mar 2003
Location:
Posted: 28th Mar 2003 15:54
The side with the gun on is the front but were the other sides are is a good question. I shall think about it...

They say that nobody is perfect, therefore i am perfect.
Chiwawa
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 28th Mar 2003 17:49 Edited at: 28th Mar 2003 17:52
hey indi..."i dont think you fully understand" this code...

this is from the TANK DEMO ..from darkbasic..and there is not 4 object..this is only hypothetic..object..

and he cant understand this code if he dont have ALL the tank demo...

ok ill explain how it work:
--------------------------------------------------------------------------


ok FOOT# is the distance between the middle and the 4 corner(each one)...
ok TA# is the angle of the 4 corner (1 each TA#) ..cause the tank in the tank demo is a box ...then... .. and the a# is the angle of the object..itself (the tank)

ok after :FRONTLEFTX# ..and the other variable like that are the X and Z of the 4 corner...
---------------------------------------------------------------------------



ok first MX# and MZ# are the position of the matrix.... its why he soustract MX# and MZ from the corner coordinate

ok and the FRONTLEFTH# and the other variable like that are the height of the 4 corner...

ACROSS# and LENGHT# are the average of the height ...of the corner...i mean see this: frontrighth#-frontlefth# is the difference between right and left front corner.. and :backrighth#-backlefth# is the diference between right and left back corner... and they add them together and divide them by 2 .... this is the average.....of the left/right height..they do same thing with back/front
-----------------------------------------------------------------------------


OK this is the tricky part.... the 5 first line i wont explain them...cause they are for animation...and simple motion...

BUT the last line: rotate object 2,wrapvalue(length#/4.0),0,wrapvalue(across#/4.0)

i CANT FIGURE how it WORK!!!!
...this is ...weird..then i made my OWN formulate to calculate the angle then replace the last line:
(rotate object 2,wrapvalue(length#/4.0),0,wrapvalue(across#/4.0))

by:
az#=wrapvalue(asin(across#/sqrt(2*110^2)))
ax#=wrapvalue(asin(length#/sqrt(2*110^2)))
rotate object 2,ax#,0,az#

and it WORK PERFECTLY ...it give EXACTLY the same thing.. ive tested it....
this is simple trigonometrie.. just calculate the angle on X and X with the distance FOOT# who is 110 and average height (ACROSS# LENGHT#) and then rotate the tank.....

try it... with your tank demo...

if you dont have it ..i have it here with my modification (search for the word Chiwawa in the code..to find the modification)(you need the media):



if you want any precision ..on the part of code that ive modicated...or anything else..just ask..
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 29th Mar 2003 06:01
good work chiwawa u should spend a lot of time here answering questions

Chiwawa
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 30th Mar 2003 00:18
e.e.e in fact ive already modificated this..code.....
cause ..there is 1 and 1/2 year i wanted to see how ...lee was doing that...
but i STILL dont understand ..how

this:
rotate object 2,wrapvalue(length#/4.0),0,wrapvalue(across#/4.0)

and this:
az#=wrapvalue(asin(across#/sqrt(2*110^2)))
ax#=wrapvalue(asin(length#/sqrt(2*110^2)))
rotate object 2,ax#,0,az#


can give the SAME result...
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 30th Mar 2003 05:31
because all you're doing is finding out 1/4 of the lenght of the values, no matter the distance you travel during this span the rotation is always 1/4 of the position it is on

i mean how Lee did it was just a quick hack because not doubt he neither had the time or want it to look too complex...
yours will produce a more precise result - but his for all intensive purposes is close enough not to matter. When physics aren't exactly the most paramount thing on your mind you figure out the adverage values that the complex trig or algebra equasions can provide and there you have your value
it save quite a bit of processing power, atleast when you use something like this in more and more abundance

you understand now?

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Chiwawa
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 30th Mar 2003 08:53
yeah thx
but i like physic ...and i wont take shortcut
shame to you lee!!!
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 30th Mar 2003 15:19
hehee its not just lee who does it... and not everyone likes or understands physics

you'll find when you get higher and higher that people demand better and better results but you don't have the technology to produce - for example a RealTime Normalisation using Phong would be slow even on todays brands of cards, you'd be talking Quake kinda game with real phong shading on a GeForce4 Ti 4200 w/1Ghz Processor would run at around what 50-60fps

but something that was made back in like '94-'95 to improve 3D with the advent of DirectX and such so they didn't have to use Gouroud (which is pretty aweful) was they made a hack version of Phong which was dubbed Fast Phong - it is still the primary used equasion for most shading effects for games, as it produces similar results to Phong except it is at a faction of the speed
i mean the main difference is it take alot of values for granted rather than calculating them makes it smaller code, and quicker without so many calculations or complexities.

Bump Mapping is another example, it is cheaper to use a second premade map which is black&white - which you can just offset a litte based on the light vector ... delta against the normal, poof you have your offset - which is quicker than doing it based on the actual lightness of each pixel and the light direction

hehee - i mean i wouldn't do it all the time, but when values can eb granted as givens it is always a good way to improve speed (^_^)

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Chiwawa
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 30th Mar 2003 21:03
yeah...maybe but ... in this case ... a gain of 2 line WOUHOU!!!
anyway ....i know its faster.. but i love phisic... maybe if i was doing the 20 line challenge..and i had 2 execedent line...

Login to post a reply

Server time is: 2026-06-11 11:23:37
Your offset time is: 2026-06-11 11:23:37