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.

DLL Talk / EZrotate - Using predetermined normal values

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Jan 2005 18:55
Is it possible to inject my predetermined normals into EZrotate?

An explanation: I have NGC, I cast a ray, I get the normals from NGC. Now, I want to tilt my vehicle on the landscape.

As far as I can see, I would have to get the coordinates from NGC for 3 points on the landscape and let EZrotate calculate the normals itself. This increases the workload by a large amount - from one raycast and 3 GetNormals, to 3 raycasts, and 9 GetPositions, followed by EZrotates normal calculations.

BatVink
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 31st Jan 2005 21:45
If you are able to get the surface normal from NG, then you can use that normal with the "EZro_PolyAlign" feature.

SYNTAX
EZro_PolyAlign Angle#, NormalX#, NormalY#, NormalZ#

Angle# = The facing angle of your object
NormalX#, NormalY#, NormalZ# = The surface normal

Then, just use the following commands to retreive new Euler angles for your object:
EZro_GetPolyAlignAngleX()
EZro_GetPolyAlignAngleY()
EZro_GetPolyAlignAngleZ()

Hope this helps!

EZrotate!
Tokamak Physics Wrapper!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Jan 2005 21:58
Cheers Wolf!!!

I wish I'd listened better in Maths at school I sit there, staring at the help files, knowing the answer is there, but not being able to find it!

BatVink
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 31st Jan 2005 22:20
lol

No problems. Glad to help. I think EZrotate covers just about everything most people will need to do with rotation now. If you ever get stuck with something, just ask away. More than likely there is a SIMPLER way to do it with EZrotate.

By the way, e-mailing me is the best way of contacting me. I've hardly been on the forums lately, and with a new baby due in about a week, I doubt that will change anytime soon.

Ron

EZrotate!
Tokamak Physics Wrapper!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Feb 2005 00:39
Quote: "and with a new baby due in about a week"


Congrats! Is this the first Wolf-cub, or do you already have a Pack?

It's my youngest daughter's first birthday on the 6th Feb, must be around the same time yours is due.

BatVink
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 1st Feb 2005 03:28
I have 2 boys already. I don't know what this one is going to be. The due date is Feb 8th, but our 2nd was born 2 weeks early, so I guess it can happen ANY time now.

EZrotate!
Tokamak Physics Wrapper!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Feb 2005 05:19
OK...now I have more questions. I'll explain first, then ask...

I have a vehicle, and it now goes up and down, tilts and all that fantastic movement that I could never get right before.

Before this, it didn't move correctly, but it did move towards the waypoints just as I expected. It does this by having an invisible node (a plain), which always points directly at the next waypoint. Then, the vehicle uses CURVEANGLE to steer into the same direction, but without any sudden jerking movements.

So now, using the new stuff I've learned here, I think I need to change it. What I think I need is this:

1. The node always points towards the next waypoint. BUT, it sits at the same angle as the ground below it.

2. I use EZro_RotateSurfToSurf, EZro_TurnTo etc to turn the vehicle to match the node.

3. The Y rotation will have one speed (the steering speed), whereas X and Z will have another, as these control the placement of the vehicle on the terrain and need to react faster.

OK. Now if this theory is correct, the first thing I need to be able to do is EZro_GetPolyAlignAngleX/Y/Z() for the node (I can do this!), but AT THE SAME TIME, point the node at the next waypoint. I think I could do this using DB Pro's native POINT OBJECT, followed by the EZrotate commands, but I'm probably going to use a long-winded method if I'm not careful.

Can you give me any advice here? I think this could help a few people, as it's fundamental to any car game on an uneven terrain.

BatVink
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 2nd Feb 2005 02:00
Batvink,
Sorry I haven't had the time for a proper reply. You can do what you are after pretty easily. Look at example 11 that came with EZrotate. It demontates a turret system that aims at a waypoint. You can basicly do the same thing. Position your object with the poly align feature. Then use the "Find Local Y-angle To Point" feature to find how much rotation is needed to point directly at your waypoint. You can then do a local Y rotation in the amount of your steering speed to head toward the waypoint.
Prime8 has also written a couple of usefull functions for complex turret systems. You can find the info on my site (in the forums).

I hope this helps....

Ron

EZrotate!
Tokamak Physics Wrapper!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Feb 2005 04:33
Thanks again, I'll look into them. Couldn't get my head around setting the global Y angle of the vehicle using CurveAngle etc, and still being able to keep track of it.

BatVink

Login to post a reply

Server time is: 2024-11-21 14:09:23
Your offset time is: 2024-11-21 14:09:23