Not sure what you're after. Are you trying to hide the faces from inside the model? Just turn on culling (d3d_set_culling(true)). That will hide any faces pointing away from the camera.
- Game Maker Community
- → Viewing Profile: Posts: jsorgeagames
jsorgeagames
Member Since 02 Jul 2007Offline Last Active Today, 03:42 AM
Community Stats
- Group GMC Member
- Active Posts 622
- Profile Views 7135
- Member Title GMC Member
- Age 18 years old
- Birthday April 12, 1995
-
Gender
Male
-
Interests
Game Maker, game design, computer science, drawing, singing
-
Version
GM8.1
Latest Visitors
Posts I've Made
In Topic: Water- How Do You Do It?
22 May 2013 - 09:34 AM
In Topic: Minecraft-Type Viewing: Where Looking At W/ Mouse?
22 May 2013 - 09:16 AM
Basically, you just need to change the player's direction as Magnusbon said. Here's an example. I used some extra variables to clean it up a bit, you don't need those.
First, you want to get the mouse's position on the screen, relative to the center of the game window.
var window_cx, window_cy, mouse_dx, mouse_dy; window_cx = window_get_x() + window_get_width()/2; window_cy = window_get_y() + window_get_height()/2; mouse_dx = display_mouse_get_x()-window_cx; mouse_dy = display_mouse_get_y()-window_cy;
Next you need to reset the mouse to the center of the game window. This way, you can get the mouse x and y change every step without worrying about the mouse hitting the edge of the screen.
display_mouse_set(window_cx,window_cy);
Now you need to change the player's direction using the mouse x and y change. Make sure your up and down angle doesn't go above 90 or below -90, otherwise the camera will flip upside down.
angle += mouse_dx; z_angle -= mouse_dy; z_angle = clamp(z_angle,-89.9,89.9);
The final part is making your camera actually use those angles, right before you set your projection in the Draw event. This requires some 3d trigonometry, so you have to change the angles into radians and then put them into the trig functions.
var dx, dy, dz; dx = cos(degtorad(angle))*cos(degtorad(z_angle)); dy = sin(degtorad(angle))*cos(degtorad(z_angle)); dz = sin(degtorad(z_angle)); d3d_set_projection(x,y,z,x+dx,y+dy,z+dz,0,0,1);
As for the movement, you can just use the built-in movement system if you want.
speed = 0;
if keyboard_check(ord('W'))
motion_add(angle,1);
if keyboard_check(ord('A'))
motion_add(angle+90,1);
if keyboard_check(ord('S'))
motion_add(angle+180,1);
if keyboard_check(ord('D'))
motion_add(angle+270,1);
In Topic: Resolution 3D Game
20 March 2013 - 09:46 PM
If you really need to change the size of a room, make a "setup" room that changes the size of the other room(s).
In Topic: ++ Statement Never Works For Me
12 March 2013 - 07:41 PM
EDIT: Never mind, it doesn't throw any errors in GM8.1 or GM:S. My mistake! It might be that you're using GM8, I get the exact same error. GM8 doesn't have the ++ operator, only GM:S does.
In Topic: Flow GM
01 February 2013 - 07:36 PM
As for whether this is actually allowed... I don't think so. I believe it is against the EULA to create programs that emulate the software. And if you finish this and release source code, someone can make a fake GameMaker. I don't think YoYo would want that, so keep the code and only give it to whoever asks. I have seen an alternative room editor for GameMaker and it was not removed from these forums, so it might be alright for you to keep this here too as long as it is only compatible for GameMaker.
I think it should be fine, as it doesn't actually create an executable. You'd still need a version of Game Maker to open the game and make an .exe for it.
- Game Maker Community
- → Viewing Profile: Posts: jsorgeagames
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content
