Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Amer  
#1 Posted : Thursday, February 7, 2013 10:50:13 PM(UTC)
Amer

Joined: 8/21/2011(UTC)
Posts: 28

Thanks: 1 times
Hi all,
As promised i've completed 2D water rendering using Delta Engine milestone 2.
Basically i've just added the code bellow to Renderer class.

Code:

public void DrawPrimitives(VertexPositionColor[] vertices)
        {
            draw.DisableTexturing();
            draw.DrawVertices(VerticesMode.Triangles, vertices);
        }

Video here:


Hope you like it, source code is attached.

Edited by user Thursday, February 7, 2013 10:50:45 PM(UTC)  | Reason: Not specified

File Attachment(s):
WaterDemo.zip (274kb) downloaded 10 time(s).

You cannot view/download attachments. Try to login or register.

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Joerg Schaum  
#2 Posted : Friday, February 8, 2013 9:23:21 AM(UTC)
Joerg Schaum

Joined: 10/11/2011(UTC)
Posts: 11

Thanks: 4 times
Hi Amer,

looks cool, but I get the following error (Water.cs) when I compile your source code:


Error 1 'DeltaEngine.Rendering.Renderer' does not contain a definition for 'DrawPrimitives' and no extension method 'DrawPrimitives' accepting a first argument of type 'DeltaEngine.Rendering.Renderer' could be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\fj0t0331\My Documents\Visual Studio 2010\Projects\WaterDemo\Water.cs 166 13 WaterDemo


Joerg

Offline Amer  
#3 Posted : Friday, February 8, 2013 9:37:30 AM(UTC)
Amer

Joined: 8/21/2011(UTC)
Posts: 28

Thanks: 1 times
Originally Posted by: Wolfhund Go to Quoted Post
Hi Amer,

looks cool, but I get the following error (Water.cs) when I compile your source code:


Error 1 'DeltaEngine.Rendering.Renderer' does not contain a definition for 'DrawPrimitives' and no extension method 'DrawPrimitives' accepting a first argument of type 'DeltaEngine.Rendering.Renderer' could be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\fj0t0331\My Documents\Visual Studio 2010\Projects\WaterDemo\Water.cs 166 13 WaterDemo


Joerg



Indeed you need to add the DrawPrimitives method to Renderer class, take the snippet above and add it, then you're done.

Hope this helps,
Amer
Offline Joerg Schaum  
#4 Posted : Tuesday, February 12, 2013 9:40:37 AM(UTC)
Joerg Schaum

Joined: 10/11/2011(UTC)
Posts: 11

Thanks: 4 times
Originally Posted by: Amer Go to Quoted Post
Indeed you need to add the DrawPrimitives method to Renderer class, take the snippet above and add it, then you're done.

Hope this helps,
Amer


Hi Amer,

thanks for your reply, however don't know where to add the mentioned method. Can't find any renderer class. Can you tell were excactly to add the snippet? And should it not read like this? Drawing instead of draw?

Code:

public void DrawPrimitives(VertexPositionColor[] vertices)
{
    Drawing.DisableTexturing();
    Drawing.DrawVertices(VerticesMode.Triangles, vertices);
} 


Thanks,
Joerg

Edited by user Tuesday, February 12, 2013 9:45:12 AM(UTC)  | Reason: Code Formatting

Offline Amer  
#5 Posted : Tuesday, February 12, 2013 11:19:32 AM(UTC)
Amer

Joined: 8/21/2011(UTC)
Posts: 28

Thanks: 1 times
Originally Posted by: Wolfhund Go to Quoted Post
Hi Amer,

thanks for your reply, however don't know where to add the mentioned method. Can't find any renderer class. Can you tell were excactly to add the snippet? And should it not read like this? Drawing instead of draw?

Code:

public void DrawPrimitives(VertexPositionColor[] vertices)
{
    Drawing.DisableTexturing();
    Drawing.DrawVertices(VerticesMode.Triangles, vertices);
} 


Thanks,
Joerg


Sorry for not being cleaver, you need to add it into DeltaEngine\Rendering\Renderer.cs class.

Maybe someone of DE team can add it.


Offline Benjamin  
#6 Posted : Tuesday, February 12, 2013 3:18:32 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Cool stuff, yes, we will add it to our new samples section we will open soon.
Offline fg_garda  
#7 Posted : Tuesday, March 19, 2013 11:45:17 AM(UTC)
fg_garda

Joined: 3/18/2013(UTC)
Posts: 29

Thanks: 5 times
Hallo,

I just started studying DeltaEngine. With the latest release (v0.9.7.3) the Water example has some errors that I have fixed like that:

Input --> InputCommands
ToQuadraticSpace --> FromPixelSpace
renderer.Screen.ViewportPixelSize --> Viewport

I've also added DrawPrimitives to the Renderer class.
But the right click does nothing, though it calls the water class for update... any advices?
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.070 seconds.