i advise setting the opacity of the layer map to 100% to see whats going on behind the scenes.
[quote:tt3sxtvy] - Distort map is being set
- all points in the 2D world map "RED family" (to view it set the layer called maps opacity to 100% or wtv) have their distance to the camer "C" calculated
-same as before except angle this time
-STILL DEALING WITH THE 2D MAP TO GET COORDS FOR 3D a little bit of trig to find the displacement in the X axis this point encounters when rotated from the cameras viewangle. what it does is uses the points angle value, then subtracts the angle of C (which is the camera) from the angle value. this rotates the point so basically its returning a value as if that were rotating the world around the camera instead of the camera in the world. the information were given is how far from the camera in the x axis of the 2d world this specific point is from the camera ONCE the view is rotated around the camera.
-same as before except for Y axis in the 2D world.
-here we get into 3D stuff, "3DP","3DP2","Blue" are all objects to be used for 3d. theyre part of a container with a specific 2D world point object matching up to them. the stuff being done in all the following actions all do the same things.
firstly they map the y displacment value found in the 2d map to the X axis in the 3d world, 320 is added because it is the screen center. and we want the value to act from the screen center since this is the cameras focal point etc.
for the z elevation, we map the x displacement value from the 2d map as the Z axis in the 3d world. it is multiplied by -1 because a z elevation is positive when things are closer and negative when farther, unlike how X axis in 2d world is negative when closer(behind) and positive when farther(in front). 500 is added because 500 is where the 3d camera is located and if we didnt add 500, the view would be showing us what the cameras suposed to show 500 points ahead of where it should be since constructs camera is at 500 and not 0 in terms of z elevation.
the set y to 500 is simply controlling the camera height in the 3D world. by shifting the Y position of the 3d points.
the following events/actions select a P object, P being those which are at the corners of the 2Dmap and mapping the terrain quads corners using mesh displacement to the 3D points corresponding to the 2D points.
thats all there is to it really
the other events are simple to figure out, and pertain to camera control, rotation using animation frames, and the AI drivers path following.
the rotation works by getting the difference between the angle of the camera object, and the character sprite's 2D points angle. and selecting a frame of the animation corresponding to the correct rotation angle relative to the cameras view of said object.
the order of the frames in the animation is extremely important.
i was gonna put this in the file but i wrote it all in a single comment so ill just post it here.
it explains the mario kart game one, in order of the events of the MODE 7 STUFF group
then it kinda goes into no organization and explains the other not-really mode 7 stuff.
making collisions movement and such work which i didnt do in this, basically means simply doing what youd do for a top down 2D game in the 2D map. im even simply using the racecar behaviour to control the player character in this!