How do game programmers define what 3D objects are?

460 viewsOtherTechnology

For the sake of the question, imagine that I’m making a game engine from scratch by one of the popular programming languages and I would like to put an interactable crate in my game. How does the game know what a crate is? I’m thinking like they create a crate in one of the rendering software, but how do they translate that to a game? Do they do something like

`define “crate” crate.stl`

then refer to it only as “crate” to give it animation, physics and lighting properties by extra code, or does it work completely differently?

A follow up question, I want to give velocity to my crate when it’s propelled by the player. Let’s say I tell it moves on x axis by “5” when “interact” happens, how is x axis or velocity defined?

In: Technology

9 Answers

Anonymous 0 Comments

Imagine you have a really big 2D graph (easier to visualize). You can give something a position on the graph using coordinates like (2,4). You can also “move” from a given position, by saying, from (2,4) move (+3,-5), and you get a new position. This is one of the basic concepts in linear algebra (vectors). You can also create more complex objects, like a triangle, that takes up more space by saying that the object has multiple vertices, and then connecting the them with edges. You can apply this concept to 3D spaces too. Put all of this together and you have the building blocks needed to create objects in 3D spaces, move them, detect collisions, etc. (not really an el5 answer, also not really an el5 question lol)

You are viewing 1 out of 9 answers, click here to view all answers.