# EngineProgrammer

Members

92

295 Neutral

• Rank
Member

## Personal Information

• Location
Oudenaarde, Belgium
1. ## drawing in Win32

Hey everyone, I'm just having some fun with reinventing many wheels. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] I just love to understand the low level programming! So here is what I want to do: basically I want to make my own pixel drawing system. I want to create a pixel class which stores a color. After I make an array of [640][480] which will be my "screen". When I gave all pixels a color I want to draw every pixel on the screen. How can I draw all pixels on the screen? SetPixel is a very slow method so I want to avoid that. Is it possible to directly connect my pixels to the screen pixels? How does the GDI communicate with the screen pixels? How can I communicate with the screen pixels without using the GDI or SetPixel? Is it even possible? Kind regards, Jonathan

3. ## OpenGL 3D algorithm

I will gladly post my progress but it will take a while, today I realized I better learn matrices through 2D and when I understand everything I'll change to 3D. I'm making my own matrix class which will be supported with the function SetWorldTransform. This function works with XFORM but I'm not using this one. It's better to write my own calculations self so I can learn from it. When I got it all calculated I just put everything into an XFORM and transform the world. So when I understand the matrix and transform concept I go to 3D. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Or is there a better way to transform my object(rectangle, bitmap, etc)? I know matrices needs to be used to transform such an object, but I mean, is there something else to transform my world with?
4. ## Viewports

When looking at 3D projections and transformations I was thinking on 3Dsmax, which has multiple viewports. So I've tried to get my own viewport with logical units -1 to 1. Now I wonder if I'm using a modern way of setting up a viewport. I have found these functions on msdn but I have no idea if these are still used nowadays. [CODE] hDC = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &client); SetMapMode(hDC, MM_ANISOTROPIC); SetViewportOrgEx(hDC, client.right/2, client.bottom/2, 0); SetViewportExtEx(hDC, client.right, client.bottom, 0); SetWindowOrgEx(hDC, 0, 0 ,0); SetWindowExtEx(hDC, 2, 2, 0); Rectangle(hDC, 0, 0, 1, 1); EndPaint(hWnd, &ps); [/CODE] This code sets up my window to 2 logical units, from -1 to 1. So like DirectX uses his viewport. And I've changed the viewport extends so when I scale the window, the objects in the window are scaled also.
5. ## 4D Arrays?

4D "can" be visualized in 3D: [url="http://en.wikipedia.org/wiki/Tesseract"]http://en.wikipedia.org/wiki/Tesseract[/url] The fourth dimension can called whatever you like, some people say it's time, some people say it's space and some say it's an object in itself. Here is a nice link about how you project the 4D in 3D: [url="http://steve.hollasch.net/thesis/chapter4.html"]http://steve.hollasc...s/chapter4.html[/url] Four-dimensional geometry: [url="http://steve.hollasch.net/thesis/chapter2.html"]http://steve.hollasc...s/chapter2.html[/url]
6. ## OpenGL 3D algorithm

[quote name='Bacterius' timestamp='1354853787' post='5007989'] [quote]It's all learning purpose. You say that I first need to work with the CPU, how do I do that? How can I choose which one I can use to get my project running? I know the difference between both tho, cpu only does 1 thing at the time while a gpu does multiple things at the same time. But no idea when I'm using a cpu or a gpu.[/quote] If you're not sure, you're definitely using a CPU [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] You only "use" the GPU (at least the current generation) by programming little programs called shaders (in HLSL, or GLSL) which perform very specific tasks (e.g. transform vertices, or shade pixels). All the rest is done by the driver automatically. You don't actually write complete software on it. Everything that you code in C++ or C# or Java or whatever language, really, is done on your CPU. [/quote] Damn, I messed up my mind then. Thank you for clearing this out! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
7. ## OpenGL 3D algorithm

Thanks everyone! Radikalizm, I'm not trying to make a commercial software renderer [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] DirectX and OpenGL can't be beaten so I won't try to. It's all learning purpose. You say that I first need to work with the CPU, how do I do that? How can I choose which one I can use to get my project running? I know the difference between both tho, cpu only does 1 thing at the time while a gpu does multiple things at the same time. But no idea when I'm using a cpu or a gpu. DracoLacertae, thanks for the examples! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] So drawing lines isn't that hard to get in 3D [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] Before I get on to it, I bought a math book which covers every mathematics what game programming concerns. So I hope to get a line or a 3D polygon on my screen today! uglybdavis, nicely done! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
8. ## OpenGL 3D algorithm

I would like to write a small copy of DirectX.[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] How do they handle the vertices and rendering of 3D models? How should it be handled for an optimal framework/engine? If my GPU can handle all the math, how can I render my 3D model with it? I still need to use some math from your first post or don't I? I'm looking up coordinate transformations and it's quite fun. [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img] And how about particles? Like when I have 1 million particles. How should I best handle them? Do I need to do all calculations and rendering on the GPU? Or are there better/faster ways? You are helping me already but I'm still a bit confused about how it all works with the gpu / cpu thing. I want to get an optimal render system for low poly models with materials, shaders, lightning, bouncings, etc. I know the pipeline for the graphics rendering but I can't go any further than the first step at the moment. For example I want to be able to load a whole environment like COD with all players, bullets, effects in it. Kind regards, Jonathan
9. ## New Weapon technology built from scratch - New FPS written in javascript NEED FEEDBACK!

[quote name='gooncorp' timestamp='1354616824' post='5007028'] heres a death information system im working on it will have even more data when we are through a lot of this data will be sent via xml to a website where the player stats are saved thanks for checking it out [media]http://www.youtube.com/watch?v=z-FVrIwb2CI&feature=youtu.be[/media] [/quote] Your intensity of the bounced lights is on 100%? Way too much even for metal. Try to make it changeable. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Have watched some video's and I must say, really good work! Keep it up!
10. ## OpenGL 3D algorithm

I'm looking up some information what GDI exactly is and this is a quote from wikipedia. [quote]Simple games that do not require fast graphics rendering use GDI. However, GDI is relatively hard to use for advanced animation, and lacks a notion for synchronizing with individual video frames in the video card, lacks hardware rasterization for 3D, etc. Modern games usually use DirectX or OpenGL instead, which let programmers exploit the features of modern hardware.[/quote] What makes DirectX a fast graphics renderer? How you decide the speed of rendering? I just want to get low-level what programming concerns. I really want to get the knowledge into my head how it's done. GDI only limited to 2D, how do I get the 3D in my program then? I'm assuming I need to calculate every pixel and draw them manually, please correct me if I'm wrong. I want to achieve real-time rendering. Dragging a 3D model into your window and be able to translate, scale and rotate in your project. But that is not for now, first the baby steps. But I can't do this alone sadly enough. Need some help from people who have experience in this because I can't find almost anything that helps me. maybe I'm not looking in the right place. [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img] Kind regards, Jonathan
11. ## OpenGL 3D algorithm

A billion percent thank you! In Win32 there are some standard functions for example: SetWorldTransform, SetGrapicsMode, etc. and structs like XFORM. Should I make any use of those functions and structs or should I rather make my own ones? Kind regards, Jonathan
12. ## OpenGL 3D algorithm

Hey everyone, has been a while I've programmed but I'm back. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I know that re-writing existing code is useless. But I don't mind to re-write some code, I want to learn how it's done. I want to make a 3D polygon and draw it in C++, without using DirectX or OpenGL. I've been looking around after source codes or tutorials but haven't found a single tutorial that helps me. Very simple example of what I want to do: [CODE] m_Polygon = new Polygon(vertex1, vertex2, vertex3, vertex4); // where the vertexes have a X,Y,Z m_Polygon->Draw(); [/CODE] So I want to draw the 3D polygon in my 2D screen. Can someone help me with this. [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img] Thank you and kind regards, Jonathan
13. ## Humans Must Answer (2D space shooter)

Wooooaaaah that looks awesome!! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
14. ## Allocation of memory

Hi everyone! I'm digging into open source engines to understand their memory management but the more I look in it, the more confused I get. For example Unigine ( it's a nice engine ) uses different headers for all kind of allocations. [CODE] struct FixedChunk; struct FixedAllocator; struct HeapChunk; struct HeapPool; struct HeapAllocator; struct SystemAllocator; struct Allocator; struct Memory; [/CODE] Why are they using so many structs(all in different headers)? An allocator is an allocator so why don't they just write 1 struct: Allocator. and use it for everything. I don't get it why they uses so many structs. So if someone could explain this for me, thank you! ~EngineProgrammer