Search Results

Search found 2862 results on 115 pages for '3d'.

Page 4/115 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • loading 3d model data into buffers

    - by mulletdevil
    I am using assimp to load 3d model data. I have noticed that each loaded model is made up of different meshes. I was wondering should each mesh have it's own vertex/index buffer or should there just be one for the whole model? From looking through the index data that is loaded it seems to suggest that I will need a vertex buffer per mesh but I'm not 100% sure. I am using C++ and DirectX9 Thank you, Mark

    Read the article

  • 2D camera perspective projection from 3D coordinates -- HOW?

    - by Jack
    I am developing a camera for a 2D game with a top-down view that has depth. It's almost a 3D camera. Basically, every object has a Z even though it is in 2D, and similarly to parallax layers their position, scale and rotation speed vary based on their Z. I guess this would be a perspective projection. But I am having trouble converting the objects' 3D coordinates into the 2D space of the screen so that everything has correct perspective and scale. I never learned matrices though I did dig the topic a bit today. I tried without using matrices thanks to this article but every attempt gave awkward results. I'm using ActionScript 3 and Flash 11+ (Starling), where the screen coordinates work like this: Left-handed coordinates system illustration I can explain further what I did if you want to help me sort out what's wrong, or you can directly tell me how you would do it properly. In case you prefer the former, read on. These are images showing the formulas I used: upload.wikimedia.org/math/1/c/8/1c89722619b756d05adb4ea38ee6f62b.png upload.wikimedia.org/math/d/4/0/d4069770c68cb8f1aa4b5cfc57e81bc3.png (Sorry new users can't post images, but both are from the wikipedia article linked above, section "Perspective projection". That's where you'll find what all variables mean, too) The long formula is greatly simplified because I believe a normal top-down 2D camera has no X/Y/Z rotation values (correct ?). Then it becomes d = a - c. Still, I can't get it to work. Maybe you could explain what numbers I should put in a(xyz), c(xyz), theta(xyz), and particularly, e(xyz) ? I don't quite get how e is different than c in my case. c.z is also an issue to me. If the Z of the camera's target object is 0, should the camera's Z be something like -600 ? ( = focal length of 600) Whatever I do, it's wrong. I only got it to work when I used arbitrary calculations that "looked" right, like most cameras with parallax layers seem to do, but that's fake! ;) If I want objects to travel between Z layers I might as well do it right. :) Thanks a lot for your help!

    Read the article

  • 3D models overlapping each other

    - by Auren
    I have a problem at the moment when I draw some models to teach me more about 3D game programming. The models at the moment overlaps each other from some angles witch makes sense since the game at the moment draws from left to right, line after line. However my question is: Is there any easy escape from this issue or is there any way that you could draw the in-game world from the players position? I would really appreciate if someone could give me some answers on this.

    Read the article

  • fast 3d point -> cuboid volume intersection test

    - by user1130477
    Im trying to test whether a point lies within a 3d volume defined by 8 points. I know I can use the plane equation to check that the signed distance is always -1 for all 6 sides, but does anyone know of a faster way or could point me to some code? Thanks EDIT: I should add that ideally the test would produce 3 linear interpolation parameters which would lie in the range 0..1 to indicate that the point is within the volume for each axis (since I will have to calculate these later if the point is found to be in the volume)

    Read the article

  • Are high powered 3D game engines better at 2D games than engines made for 2D

    - by Adam
    I'm a software engineer that's new to game programming so forgive me if this is a dumb question as I don't know that much about game engines. If I was building a 2D game am I better off going with an engine like Torque that looks like it's built for 2D, or would higher powered engines like Unreal, Source and Unity work better? I'm mainly asking if 2D vs 3D is a large factor in choosing an engine. For the purpose of comparison, let's eliminate variables by saying price isn't a factor (even though it probably is). EDIT: I should probably also mention that the game we're developing has a lot of RTS and RPG elements regarding leveling up

    Read the article

  • 3D Huge mesh rendering

    - by Keyhan Asghari
    I am writing a program, that as input, I have a huge 3d mesh (with mostly structured and cubic shaped elements), and I want to realtime render it, but not as real-time as a game. But speed of rendering is somehow important. The most important point is, I don't need any special lighting nor any shadows. Also, the objects to render are static, and they do not move. I've read about ray tracing methods, but I don't know if there is any good libraries for this purpose, or I have to implement everything by myself. Thanks a lot.

    Read the article

  • Learning resource for 3d modeling

    - by Maik Klein
    I want to start learning 3d modeling. I already have experience with maya and 3dsmax but I made a long pause (2 years) Now I have free access to maya, 3dsmax and blender (I am a student). I know that all tools are very powerful so I thought I just pick the one with the best learning materials. The best site that I found is http://www.digitaltutors.com/11/index.php and it has over 7600 videos for maya. Maybe you can recommend me some other learning sites that are as good as digitaltutors?

    Read the article

  • 3D Ray Casting / Picking

    - by Chris
    Hi, I am not sure if I should post this link, but I feel this falls into game development just as much as it does math. I have a ray cast's far and near values and I am trying to calculate the end point of the ray so that I can either draw a line to show the ray, or render an object at the end of 3d mouse position. Here is my post on the stack overflow math site, if there is a problem with me doing this just close the thread. Thank you. http://math.stackexchange.com/questions/15918/help-with-matrix-mathematica

    Read the article

  • as3 3D camera lookat

    - by Johannes Jensen
    I'm making a 3D camera scene in Flash, draw using drawTriangles() and rotated and translated using a Matrix3D. I've got the camera to look after a specific point, but only on the Y-axis, using the x and z coordinates, here is my code so far: var dx:Number = camera.x - lookAt.x; var dy:Number = camera.y - lookAt.y; var dz:Number = camera.z - lookAt.z; camera.rotationY = Math.atan2(dz, dx) * (180 / Math.PI) + 270; so no matter the x or z position, the point is always on the mid of the screen, IF and only if y matches with the camera. So what I need is to calculate the rotationX (which are measured in degrees not radians), and I was wondering how I would do this?

    Read the article

  • 3D texture coordinates for a cube

    - by Roshan
    I want to use glTexImage3D with cube. what will be the texture coordinates for it? i am using GL_TEXTURE_3D as target. I tried with u v coordinates same as 2d texture coordinates with z component 0-depth for each face. But that goes wrong. How to apply each layer to each face of the cube with target= GL_TEXTURE_3D? Lets assume i have 8 layers of 2D images in my 3D texture. I want all 8 layers to apply on each of the cube and not 1 layer on 1 face of the cube.

    Read the article

  • Any 3D, Isometric, RPG oriented engines?

    - by Don Quixote
    I was wondering if there are any game engines out there that are oriented towards isometric, 3D RPGs such as Diablo 3, Torchlight, Magika, etc.. Most engines I found so far are either oriented towards FPS, such as Cry Engine and UDK, or are far too generic, such as the Irrlicht engine, which will add what I think is unnecessary work on the engine instead of the game. Any chance there are any engines out there that are crafted to be more suitable for RPGs? I would prefer they be in Java, since it's more my forte, but beggars can't be choosers, so C++ is great as well! Thank you.

    Read the article

  • Where to start? (3D Modeling)

    - by herfus
    I'm looking for a good resource to start learning 3d modeling. I'm looking for something that starts with the basics (e.g. terminology; what are quads, triangles etc.) before/while going into the actual modeling. Book, website, video, anything will do. I'm only concerned with the quality of the tutorials, how thorough they are. I have experience with texturing, level design and so on - but I've never created anything more than simple shapes/editing existing assets.

    Read the article

  • Path Finding for an Arena based map in 3D using NavMesh

    - by Happybirthday
    I have a 3D arena map (consider a small island surrounded by water on all sides) for a multiplayer Tank fight game. The moveable areas are marked using a Navigation Mesh made by the Arena designer. My question is what would be the best way for navigation in such an environment ? Specially considering the case when there is a Bridge at the center of the arena and you could walk under it or even above it ? If suppose the enemy is standing at the top of the Bridge and my AI is at one of the edges of the map ? How can it know whether the enemy is above or below the bridge and how can it navigate till it ?

    Read the article

  • Rotation matrix for a 3D vector

    - by Shashwat
    I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan inverse. I think this is a complex task to do. Also, eventually those are also converted to sin(angle) and cos(angle) in the matrix. Is there any inbuilt way to create rotation matrix from a 3D vector? However, I can write the function but still asking if there is one already there.

    Read the article

  • Panning a 3d viewport in 2d direction with rotated camera

    - by Noob Game Developer
    I am using below code to pan the viewport (action script 3 code using flare3d framework) _mainCamera.x-= Input3D.mouseXSpeed; _mainCamera.z+= Input3D.mouseYSpeed; Where as Input3D.mouse[X|Y]Speed gives the displacement of the mouse on the X/Y axis starting from the position of the last frame. This works perfect if my camera is not rotated. However, if I rotate the camera (x by 30, y by 60) and pan the camera then it goes wrong. Which is actually correctly panning according to the code. But this is not desired and I know I need to do some math to get the correct x/y which I am not aware of it. Can some one help me achieving it? Update: I am getting an Idea but I am not sure how to do it :( Get the mouseX/Y deltas (xd,yd) Get the current camera coords (pos3d) Convert to screen coords (pos2d) Add deltas to screen coords (pos2d+ (xd,yd)) Convert above coords to 3d coords

    Read the article

  • 3D mobile game development [on hold]

    - by SCM
    I am not a developer or programmer and, I am planning an educative project that will involve having students to develop a cross-platform, 3D mobile game, similar to the SimCity concept. I need to write a project requirement and I'd like to pick someone's brain to understand what's involved in developing such a project: -Is it realistic to have one or two students to do it? and along their other modules at uni? - How much time can it take to develop from scratch? - what are the different skills required? Thank you All SCM

    Read the article

  • How to test 3d acceleration?

    - by HappyDeveloper
    I want to install and test 3d acceleration in Ubuntu 12. I have read these pages: https://help.ubuntu.com/community/RadeonDriver https://wiki.ubuntu.com/X/Troubleshooting/VideoDriverDetection?action=show&redirect=X%2FTroubleshooting%2FFglrxInteferesWithRadeonDriver#Problem:_Need_to_purge_-fglrx I think I have installed it correctly, but I don't know how to test it. I tried to play minecraft in the browser, but I got a black screen. It may be a java problem too, so I need to troubleshoot. So how can I test my video card and drivers?

    Read the article

  • 3d Collision Handling

    - by TobSpr
    I have trouble while detecting collisions on my 3D-Game. I have set-up Rays, to detect collisions (Screenshot) and my main-rountine already analyzes them. But now there's the question what to do with that. One possibility would be, to move the player back to the last position, but that's dirty, and does not work if the player can walk in multiple directions (e.g. if the player runs along a wall). My question is, what to do with the collision data / or in which direction, by which amount move the player? I'm sure there is an algorithm for that (as for almost all is).

    Read the article

  • Easiest Way to Get Started With 3D?

    - by ryebread761
    I'm looking at getting into 3D game development and am wondering what would be the best, quickest engine to get started with. I need to be able to develop on a Macintosh with it. I know Java, and PHP mainly but have worked in many others. At this point, I feel I can adapt to most languages quite easy. So the programming language doesn't really matter to me. I've sorta kinda tried unity in the past and wasn't all too fond of it, so it's kind of a "I can't find anything better" resort. I'm hoping with how open I am I will find something I like more. Thanks in advance.

    Read the article

  • Relative Positions Of Player And Enemy Are Different In XNA 3D Game

    - by CoOlDud3
    I am having a problem in my 3D Jet Fighter Game using XNA. I have a Player Jet and a few enemy drones built from a separate class. The problem is that when I set Player position and a drone's position to a height 10f in y direction. They aren't at the same height. But if i move Drone's Position up 500f in the y direction then it is pretty much close to the player. Relatively They are supposedly at the same height but with different position values. Can Any One Help Please?

    Read the article

  • 3D Mesh Collision Help

    - by BlackAfricano
    I am new to XNA (I have only been working in it for a countable number of weeks) as well as to these forums (I have only made 1-2 other posts), so this may seem like a strange request, but I am wondering if anybody knows about more advanced collision in XNA. So far I have only been able to figure out BoundingSphere's which seem to be the simplest of the methods, and I was thinking of looking more into BoundingBoxes because the game I have is a 2-3D platformer. The problem I realized was that if I wanted to get any more advanced than stages in the shape of a box, I would face some immediate dilemmas. I was hoping somebody here was knowledgeable on the subject and could inform me where I could get started learning how to do something like this: https://www.youtube.com/watch?v=ekMD_Gtt8d4 Although the game in this video isn't very pretty, the mesh collision looks like what I'm looking for. I am hoping for the most complete solution, if possible.

    Read the article

  • Converting 2D Physics to 3D.

    - by static void main
    I'm new to game physics and I am trying to adapt a simple 2D ball simulation for a 3D simulation with the Java3D library. I have this problem: Two things: 1) I noted down the values generated by the engine: X/Y are too high and minX/minY/maxY/maxX values are causing trouble. Sometimes the balls are drawing but not moving Sometimes they are going out of the panel Sometimes they're moving on little area Sometimes they just stick at one place... 2) I'm unable to select/define/set the default correct/suitable values considering the 3D graphics scaling/resolution while they are set with respect to 2D screen coordinates, that is my only problem. Please help. This is the code: public class Ball extends GameObject { private float x, y; // Ball's center (x, y) private float speedX, speedY; // Ball's speed per step in x and y private float radius; // Ball's radius // Collision detected by collision detection and response algorithm? boolean collisionDetected = false; // If collision detected, the next state of the ball. // Otherwise, meaningless. private float nextX, nextY; private float nextSpeedX, nextSpeedY; private static final float BOX_WIDTH = 640; private static final float BOX_HEIGHT = 480; /** * Constructor The velocity is specified in polar coordinates of speed and * moveAngle (for user friendliness), in Graphics coordinates with an * inverted y-axis. */ public Ball(String name1,float x, float y, float radius, float speed, float angleInDegree, Color color) { this.x = x; this.y = y; // Convert velocity from polar to rectangular x and y. this.speedX = speed * (float) Math.cos(Math.toRadians(angleInDegree)); this.speedY = speed * (float) Math.sin(Math.toRadians(angleInDegree)); this.radius = radius; } public void move() { if (collisionDetected) { // Collision detected, use the values computed. x = nextX; y = nextY; speedX = nextSpeedX; speedY = nextSpeedY; } else { // No collision, move one step and no change in speed. x += speedX; y += speedY; } collisionDetected = false; // Clear the flag for the next step } public void collideWith() { // Get the ball's bounds, offset by the radius of the ball float minX = 0.0f + radius; float minY = 0.0f + radius; float maxX = 0.0f + BOX_WIDTH - 1.0f - radius; float maxY = 0.0f + BOX_HEIGHT - 1.0f - radius; double gravAmount = 0.9811111f; double gravDir = (90 / 57.2960285258); // Try moving one full step nextX = x + speedX; nextY = y + speedY; System.out.println("In serializedBall in collision."); // If collision detected. Reflect on the x or/and y axis // and place the ball at the point of impact. if (speedX != 0) { if (nextX > maxX) { // Check maximum-X bound collisionDetected = true; nextSpeedX = -speedX; // Reflect nextSpeedY = speedY; // Same nextX = maxX; nextY = (maxX - x) * speedY / speedX + y; // speedX non-zero } else if (nextX < minX) { // Check minimum-X bound collisionDetected = true; nextSpeedX = -speedX; // Reflect nextSpeedY = speedY; // Same nextX = minX; nextY = (minX - x) * speedY / speedX + y; // speedX non-zero } } // In case the ball runs over both the borders. if (speedY != 0) { if (nextY > maxY) { // Check maximum-Y bound collisionDetected = true; nextSpeedX = speedX; // Same nextSpeedY = -speedY; // Reflect nextY = maxY; nextX = (maxY - y) * speedX / speedY + x; // speedY non-zero } else if (nextY < minY) { // Check minimum-Y bound collisionDetected = true; nextSpeedX = speedX; // Same nextSpeedY = -speedY; // Reflect nextY = minY; nextX = (minY - y) * speedX / speedY + x; // speedY non-zero } } speedX += Math.cos(gravDir) * gravAmount; speedY += Math.sin(gravDir) * gravAmount; } public float getSpeed() { return (float) Math.sqrt(speedX * speedX + speedY * speedY); } public float getMoveAngle() { return (float) Math.toDegrees(Math.atan2(speedY, speedX)); } public float getRadius() { return radius; } public float getX() { return x; } public float getY() { return y; } public void setX(float f) { x = f; } public void setY(float f) { y = f; } } Here's how I'm drawing the balls: public class 3DMovingBodies extends Applet implements Runnable { private static final int BOX_WIDTH = 800; private static final int BOX_HEIGHT = 600; private int currentNumBalls = 1; // number currently active private volatile boolean playing; private long mFrameDelay; private JFrame frame; private int currentFrameRate; private Ball[] ball = new Ball[currentNumBalls]; private Random rand; private Sphere[] sphere = new Sphere[currentNumBalls]; private Transform3D[] trans = new Transform3D[currentNumBalls]; private TransformGroup[] objTrans = new TransformGroup[currentNumBalls]; public 3DMovingBodies() { rand = new Random(); float angleInDegree = rand.nextInt(360); setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D c = new Canvas3D(config); add("Center", c); ball[0] = new Ball(0.5f, 0.0f, 0.5f, 0.4f, angleInDegree, Color.yellow); // ball[1] = new Ball(1.0f, 0.0f, 0.25f, 0.8f, angleInDegree, // Color.yellow); // ball[2] = new Ball(0.0f, 1.0f, 0.15f, 0.11f, angleInDegree, // Color.yellow); trans[0] = new Transform3D(); // trans[1] = new Transform3D(); // trans[2] = new Transform3D(); sphere[0] = new Sphere(0.5f); // sphere[1] = new Sphere(0.25f); // sphere[2] = new Sphere(0.15f); // Create a simple scene and attach it to the virtual universe BranchGroup scene = createSceneGraph(); SimpleUniverse u = new SimpleUniverse(c); u.getViewingPlatform().setNominalViewingTransform(); u.addBranchGraph(scene); startSimulation(); } public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); for (int i = 0; i < currentNumBalls; i++) { // Create a simple shape leaf node, add it to the scene graph. objTrans[i] = new TransformGroup(); objTrans[i].setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); Transform3D pos1 = new Transform3D(); pos1.setTranslation(randomPos()); objTrans[i].setTransform(pos1); objTrans[i].addChild(sphere[i]); objRoot.addChild(objTrans[i]); } BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0); Color3f light1Color = new Color3f(1.0f, 0.0f, 0.2f); Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f); DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction); light1.setInfluencingBounds(bounds); objRoot.addChild(light1); // Set up the ambient light Color3f ambientColor = new Color3f(1.0f, 1.0f, 1.0f); AmbientLight ambientLightNode = new AmbientLight(ambientColor); ambientLightNode.setInfluencingBounds(bounds); objRoot.addChild(ambientLightNode); return objRoot; } public void startSimulation() { playing = true; Thread t = new Thread(this); t.start(); } public void stop() { playing = false; } public void run() { long previousTime = System.currentTimeMillis(); long currentTime = previousTime; long elapsedTime; long totalElapsedTime = 0; int frameCount = 0; while (true) { currentTime = System.currentTimeMillis(); elapsedTime = (currentTime - previousTime); // elapsed time in // seconds totalElapsedTime += elapsedTime; if (totalElapsedTime > 1000) { currentFrameRate = frameCount; frameCount = 0; totalElapsedTime = 0; } for (int i = 0; i < currentNumBalls; i++) { ball[i].move(); ball[i].collideWith(); drawworld(); } try { Thread.sleep(88); } catch (Exception e) { e.printStackTrace(); } previousTime = currentTime; frameCount++; } } public void drawworld() { for (int i = 0; i < currentNumBalls; i++) { printTG(objTrans[i], "SteerTG"); trans[i].setTranslation(new Vector3f(ball[i].getX(), ball[i].getY(), 0.0f)); objTrans[i].setTransform(trans[i]); } } private Vector3f randomPos() /* * Return a random position vector. The numbers are hardwired to be within * the confines of the box. */ { Vector3f pos = new Vector3f(); pos.x = rand.nextFloat() * 5.0f - 2.5f; // -2.5 to 2.5 pos.y = rand.nextFloat() * 2.0f + 0.5f; // 0.5 to 2.5 pos.z = rand.nextFloat() * 5.0f - 2.5f; // -2.5 to 2.5 return pos; } // end of randomPos() public static void main(String[] args) { System.out.println("Program Started"); 3DMovingBodiesbb = new 3DMovingBodies(); bb.addKeyListener(bb); MainFrame mf = new MainFrame(bb, 600, 400); } }

    Read the article

  • Transition from 2D to 3D Game development [closed]

    - by jakebird451
    I have been working in the 2D world for a long time from manual blitting in windows to SDL to Python (pygame, pyopengl) and a bunch in between. Needless to say I have been programming for a while. So a while ago I started to program in OpenGL via C++ on my Mac. I then got a little intricate with my work after a while (3D models with skeleton structure and terrain development). After a long time of tinkering, I stopped due to the heavy work just to yield a low level understanding of how OpenGL works. Still interested in Graphics and Game Development I went on a search for a stable game engine with some features to grow on. Licence Requirement: Anything other than GPL (LGPL will do) OS Requirement: Mac & Windows Shader: GLSL or CG (GLSL preferred due to experience) Models: Any model structure with rigging (bone) support & animation I am looking at http://www.ogre3d.org/ currently and am starting to meddle around with some examples. However I am a little reluctant to spend a lot of time on it only to yield another dead end. So instead of falling down a spiraling black pit, I am posting my question to you guys to lead me in the right direction based on my requirements. How was your experience with the engine you recommend? Is it well documented? Does it have well documented examples? Any library requirements (Boost, libpng, etc)?

    Read the article

  • 3D zooming technique to maintain the relative position of an object on screen

    - by stark
    Is it possible to zoom to a certain point on screen by modifying the field of view and rotating the view of the camera as to keep that point/object in the same place on screen while zooming ? Changing the camera position is not allowed. I projected the 3D pos of the object on screen and remembered it. Then on each frame I calculate the direction to it in camera space and then I construct a rotation matrix to align this direction to Z axis (in cam space). After this, I calculate the direction from the camera to the object in world space and transform this vector with the matrix I obtained earlier and then use this final vector as the camera's new direction. And it's actually "kinda working", the problem is that it is more/less off than the camera's rotation before starting to zoom depending on the area you are trying to zoom in (larger error on edges/corners). It looks acceptable, but I'm not settling for only this. Any suggestions/resources for doing this technique perfectly? If some of you want to explain the math in detail, be my guest, I can understand these things well.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >