Vertexes?

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Vertexes?

Post by LuX » May 29th, 2012, 6:40 pm

When (you are going to, right?) are you going to teach about vertexes and that kind of stuff, chili?

I was thinking about them, while watching you tutorial 20, if it would be possible to make a 2d vertex square, add a texture on it (in this case the player from the top) and then rotate the vertex, so you wouldn't have to create thousands of images of the player in different angles. Or would it in such case be easier to make some kind of image rotating thing and how hard would that be compared to the first thought? Or other opinions?

Looked at some other vertex tutorial, but since they use a different framework its a bit harder to implement it to chili's framework. There was this one tutorial, however, which used a similar framework so I followed it and made a single vertex. While it didn't cause an error, it didn't show up either. I think the problem lies in the buffer implementation, since the tutorial used another type of buffer than the one in D3DGraphics, so I tried to somehow squeeze it in, most likely fucking things up...

Not asking for a full tutorial, here right now (unless you have time to make a quick example : -) ), but if someone who knows about this stuff could have a look and tell if I made some simple easy-to-fix mistake or if its from the beginning to the end all wrong and point out the errors?
Attachments
Vertex test.rar
(43.18 KiB) Downloaded 192 times
ʕ •ᴥ•ʔ

uglypie
Posts: 21
Joined: May 5th, 2012, 5:05 pm

Re: Vertexes?

Post by uglypie » May 30th, 2012, 8:27 am

I don't know what's wrong, but looking at the HRESULTS from the different function calls, it revealed that DrawPrimitive did not succeed. The error code returned was 0x8876086C. There is a tool called directx error lookup which I think is included with the SDK. Try to search for it in the start menu. There you can look up the error codes. Turns out that the error code was "Invalid call", whatever that could mean.

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Vertexes?

Post by LuX » May 30th, 2012, 11:04 am

Hmm... I haven't done almost any work regarding vertexes so I have no idea how to fix this.
In the tutorial it was told that DrawPrimitive is not the best way to do vertexes but its one of the simplest ways.

But thanks for taking the time to investigate.
ʕ •ᴥ•ʔ

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Vertexes?

Post by chili » May 30th, 2012, 2:37 pm

LuX wrote:When (you are going to, right?) are you going to teach about vertexes and that kind of stuff, chili?
This question is perhaps missing the mark. There is nothing special about vertices (they are just points in space). I think what you mean to ask is either: (a) when will you be teaching linear transformations (rotation, scaling, translation, shearing, etc.); (b) when will you be teaching 3D graphics theory; or (c) when will you be teaching hardware-accellerated Direct3D graphics rendering.

The answers for the various cases are as follows:

(a) quite soon (within 4 to 6 lessons maybe)
(b) depends on the feedback I get from you guys, but at the earliest about 10 lessons from now
(c) quite some time from now, unless perhaps I create a splinter lesson series
LuX wrote:I was thinking about them, while watching you tutorial 20, if it would be possible to make a 2d vertex square, add a texture on it (in this case the player from the top) and then rotate the vertex, so you wouldn't have to create thousands of images of the player in different angles. Or would it in such case be easier to make some kind of image rotating thing and how hard would that be compared to the first thought? Or other opinions?
Yes, it would be possible. This is how 2D sprites are done with hardware accelleration. Like you say, it works only really in cases where the axis of rotation points directly into the screen. Rotating an image is essentially the same thing as texturing a quad and rotating that. It's all the same math (the math that I used in the Spirocrap program).
LuX wrote:Not asking for a full tutorial, here right now (unless you have time to make a quick example : -) ), but if someone who knows about this stuff could have a look and tell if I made some simple easy-to-fix mistake or if its from the beginning to the end all wrong and point out the errors?
Actually there is a lot that would prevent this from working. Trying to render the primitive when the framebuffer is locked. Releasing the vertex buffer after presenting the first frame. Using the fixed function pipeline with a pure device. It's really too much for me to go over here. Maybe try fooling around with some triangle drawing code just as it is, without trying to pull it into the framework. :)
Chili

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Vertexes?

Post by LuX » May 30th, 2012, 3:21 pm

Yeah, I put my bet on the whole thing being screwd...

Anyways. When I asked about tutorials for vertexes, what I meant, is generally vertexes. Looking at any other tutorial series they usually jump right to vertexes, first basic "2d" vertexes, texturing, diffuse lighting and from there to 3d and light mapping and that kind of stuff. So I somehow figured we would at some point go to this kind of a line.

I'll have a look at that spirograph again. Maybe I'll figure out something useful for a texture rotation.
ʕ •ᴥ•ʔ

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Vertexes?

Post by Asimov » May 31st, 2012, 10:08 pm

Hi Lux,

Usually if I am doing 3D stuff I have used the Unity game engine, and recently Cry Engine. I am not sure we could even get close to that level of detail seeing as they use whole teams of programmers.

However I agree a tutorial on 3D graphics would be interesting, but I think the maths would be far above my head heh heh.

Just thought you might like to see my 3D gallery http://www.asimoventerprises.co.uk/minigal/index.php

I don't have my game 3d models on their though as I am under an NDA on some of the stuff I have built recently.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Vertexes?

Post by LuX » June 1st, 2012, 9:54 am

Cool stuff you have there. I've done some work in maya as well, done some 3d weapons and stuff, but I somehow lost interest in it. Just takes too damn much time to do epic 3d stuff, and I didn't have the talent to use them in any game anyways...

Maybe someday I'll install unity again and try to pull out something after I have a better understanding in c++. If I remember correctly unity uses c++.
ʕ •ᴥ•ʔ

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Vertexes?

Post by Asimov » June 1st, 2012, 11:56 am

Hi Lux,

I think there is an addon you can use to use C++, but Unity mainly uses javascript, C# and boo.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Vertexes?

Post by chili » June 1st, 2012, 12:09 pm

I think you can use C# in Unity (as Asimov says). If you want to extend the engine with plugins, you can do so with C++.

CryEngine is mostly C++ stuff, but the AI is in LUA I believe.
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Vertexes?

Post by Asimov » June 2nd, 2012, 3:24 pm

Hi Lux,

The cry engine is good, but programming the engine is a pain as it is the most undocumented engine in the world.

I made an online demo in Unity which is hidden on my webpage somewhere and I used all javascript. It is a pain that Unity doesn't use C++ though. Don't get me wrong C# is a good language and I have used it with XNA, but this is my problem. When I am programming in C# I am forgetting my C++ stuff and vica versa.

Ok here is the link to my online demo of Unity
http://www.asimoventerprises.co.uk/house.php

Hope posting links is not allowed, as I am not doing it to advertise anything or anything.

Wouldn't it be nice if all engines used C++ as well.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

Post Reply