Gamestudio Links
Zorro Links
Newest Posts
Why Zorro supports up to 72 cores?
by 11honza11. 04/26/24 08:55
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, VoroneTZ, Quad, 1 invisible), 826 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 18 of 23 1 2 16 17 18 19 20 22 23
Re: C# wrapper 2.3.3 - RELEASE [Re: Rackscha] #381370
08/27/11 05:57
08/27/11 05:57
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
hmmm i don't know that much about particles, but the way you described : storing the other delegate and then using it should work fine !


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.3 - RELEASE [Re: Stromausfall] #386475
11/03/11 17:24
11/03/11 17:24
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 283
Germany
Hi,
I have a problem.
I am using ent_getvertex/ent_setvertex to morph my models. This works fine until you call the function ent_fixnormals. This resets the mesh to the prvious version. I did not observe the same behaviour in Lite-C.
MfG,
Patrick

Re: C# wrapper 2.3.3 - RELEASE [Re: jenGs] #386888
11/10/11 14:25
11/10/11 14:25
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
hmm i can't seem to reproduce that behaviour... can you tell me more about the instance where this problem occured or maybe even send me a small demo project where the problem occurs ?

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AcknexWrapper;

namespace Test
{
    class Program
    {
        //the main method, called by the scheduler
        private static IEnumerable<ScheduleMethod> myMainMethod()
        {
            EngFun.level_load(null);

            yield return 1;

            ENTITY terrain =             
                ENTITY.ent_createterrain(null, new Vector(100, 0, -5), 10, 10, 5);

            // wait a frame, before changing the terrain !
            yield return 1;

            CONTACT c =
                terrain.ent_getvertex(null, 7);

            c.z += 10;  // increase the vertex height
            c.v = null; // c.x,y,z was changed, instead of c.v      
            terrain.ent_setvertex(c, 7);    // update the mesh

            terrain.ent_fixnormals(0);
        }

        static void Main(string[] args)
        {
            //open the engine
            EngFun.engine_open(null, null);

            //start the scheduler
            Scheduler.StartScheduler(myMainMethod);
        }
    }
}




get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
C# wrapper 2.3.4 - RELEASE [Re: Stromausfall] #386908
11/10/11 20:38
11/10/11 20:38
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
a new version was uploaded (for Acknex 7.85.4 AND Acknex 8.30.4)
the update of the wrapper includes:

- updated to work with A8.30.4

here's the link:

AcknexWrapper_2_3_4_FOR_8_30_4_AND_7_85_4.zip


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.4 - RELEASE [Re: Stromausfall] #386985
11/12/11 09:55
11/12/11 09:55
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Thank you very much for your ongoing development of this great wrapper! laugh


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: C# wrapper 2.3.3 - RELEASE [Re: Stromausfall] #387447
11/18/11 19:02
11/18/11 19:02
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 283
Germany
Hi,
Sorry for my long response time. Here is a demo Project. It is a vs2010 sollution in debug build mode.
demo
If you press f1 the terrain is morphed randomly, if you press f3 the mdl is morphed.
On f2 you can call fixnormals for the terrain, on f4 you can call fixnormals for the mdl.
Thank you for taking the time to look onto this.

Re: C# wrapper 2.3.3 - RELEASE [Re: jenGs] #387536
11/20/11 11:54
11/20/11 11:54
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Hi !
i finally found some time to look at the example !
This is indeed a strange bug ! I tried to convert the code from the example to lite-c - there the problem happens too (at least for me!) !
It seems to me that this problem is not isolated to the C# wrapper ! I tried several other things, but it somehow seems that ent_fixnormals always resets to the original state of the terrain ...
Does the problem also occur for you in lite-c with this code ? :

(edited) :
I just discovered that the code i previously posted, in which I said that i can't reproduce the error, now also produces this error !

I guess this is because i used 8.20.1 when i wasn't able to reproduce the error but now after updating to 8.30.5, the error is always produced....

THUS i think the error somehow smuggled itself into existence between A8.20.1 and A8.30.5 ! That's why I guess this is a engine bug, caused by the new Acknex version !

Code:
// we can't use default.c because there f1 - f4 are already preset with some other stuff !

#include <acknex.h>

ENTITY *demoTerrain;
ENTITY *demoModel;

void MorphTerrain()
{
	int i;
	
	for (i = 0; i < ent_status(demoTerrain, 0); i++)
	{
		CONTACT *c = ent_getvertex(demoTerrain, NULL, i);
		c.z += random(10);
		c.v = NULL;
		ent_setvertex(demoTerrain, c, i);
	}
}

void MorphModel()
{
	int i;
	
	for (i = 0; i < ent_status(demoModel, 0); i++)
	{
		CONTACT *c = ent_getvertex(demoModel, NULL, i);
		c.z += random(10);
		c.v = NULL;
		ent_setvertex(demoModel, c, i);
	}
}

void FixNormalsTerrain()
{
	ent_fixnormals(demoTerrain, 0);
}

void FixNormalsModel()
{
	ent_fixnormals(demoModel, 0);
}

void SetUpDemo()
{
	camera.x = -1676;
	camera.y = 432;
	camera.z = 1126;
	camera.pan = 0;
	camera.tilt = -35;
	
	BMAP *grey = bmap_createblack(512, 512, 24);
	bmap_fill(grey, vector(128,128,128), 100);
	demoTerrain = ent_createterrain(grey, vector(0,0,0), 16, 16, 64);
	
	demoModel = ent_create("plane.mdl", vector(0, 1040, 0), NULL);
}

int main()
{
	mouse_mode = 4;
	mouse_pointer = 2;
	mouse_sync = 1;
	video_switch(10, 32, 2);
	wait(1);
	level_load(NULL);
	sun_light = 100;
	sun_pos.x = 80;
	sun_pos.y = 154;
	sun_pos.z = 0;
	SetUpDemo();
	
	on_f1 = MorphTerrain;
	on_f2 = FixNormalsTerrain;
	on_f3 = MorphModel;
	on_f4 = FixNormalsModel;
}



P.S.:
@Dark_samurai : Thank you laugh

Last edited by Stromausfall; 11/20/11 12:08.

get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.3 - RELEASE [Re: Stromausfall] #387562
11/20/11 17:57
11/20/11 17:57
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 283
Germany
Hi,
Thank you for looking laugh
Now I get the problem too. Figured out that my Laptop had an old Acknex version. I tested the Lite-C version with it and the c# version with my desktop PC which is up to date in Acknex matters.
So this seems to be a bug-Forum case. I will open a topic there when I have some time today.
MfG,
Patrick

Re: C# wrapper 2.3.3 - RELEASE [Re: jenGs] #390738
01/04/12 12:18
01/04/12 12:18
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
hey stromausfall!
i'm asking another time:
could you please change some things in your wrapper?
you simply copied all acknex functions to lite-c, but your wrapper could be much more powerful.
Atm i'm changing a lot of stuff to have faster results.
so some suggestions what to change:

  • Allow users to set vectors per =, not only per vec_set. Some possible solution:
    Code:
    public Color blueGreenRed
    {
    	get
    	{
    		return Color.createFromPointer(bluePointer);
    	}
    	set
    	{
    		Color.createFromPointer(bluePointer).vec_set(value);
    	}
    }
    
    
  • Please add constructors to your classe. Eg:
    Code:
    new ENTITY("mymodel.mdl", new Vector(1,2,3), new EventIntPtr(pla));
    new PANEL("pos_x = 5; pos_y =10; flags = SHOW;",6);
    ...
    
    
  • Add a implicit cast to the Vector class, so we can write this:
    Code:
    double x = myent.xyz;
    myent.xyz = 4;
    
    
    This looks a little weird, but you can now also simply remove this xyz-vector and name it x. This results in the simple gamestudio style:
    Code:
    myent.x = new Vector(1,2,3);
    double x = myent.x;
    myent.x = 4;
    Vector k = myent.x;
    
    
  • Add a Tag property to all objects (like in WinForms), so we can store custom objects into the engine objects
  • Also you could split the class ENTITY into ViewEntity and WorldEntity, so we can differ also in code and it will be much clearer what is used.
  • another thing what would be nice: remove all prefixes of the class functions. this looks simply strange. much better would be this:
    Code:
    Entity myEnt = new Entity("lalala.mdl",new Vector(4,5,6),null);
    myEnt.animate("walk",50,AnimationMode.None);
    myEnt.remove();
    
    
  • Also if you change the constructor thing, you can add this constructor to Entity:
    Code:
    public Entity(string modelFile, Vector position)
    
    
    Because sometimes we don't need an entity event or we manage those things ourselves, so we don't need this parameter.


Would be really cool if we could see some of my suggestions in the next version of the wrapper!

Greetz Felix

A little bit offtopic:
If someone needs some cool libraries c# (network and multitouch, both useable with gs):
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=390042#Post390042


Visit my site: www.masterq32.de
Re: C# wrapper 2.3.3 - RELEASE [Re: MasterQ32] #390925
01/05/12 22:55
01/05/12 22:55
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
hi !

>>Allow users to set vectors per =, not only per vec_set. Some possible solution:
I don't think that that's an optimal solution, as it suggests that the Vector object is actually assigned, which would mean that
Code:
Vector temp = new Vector(2, 3, 4);
entity.xyz = temp;

temp.x = 2000;

// I would expect entity.x now to be 2000 ! but it wouldn't be that way !



>>Please add constructors to your classe. Eg:
i already once used constructors for this, but static methods are preferable for me, as with static constructors it's immediately clear which method is used to construct the object, with a normal constructor, one has to read, guess or search (because only the number/types of arguments would change for the constructors)!

>>Add a implicit cast to the Vector class, so we can write this:
looks too weird imho


>>Add a Tag property to all objects (like in WinForms), so we can store custom objects into the engine objects

i currently don't know what Tags are for, I had a quick look and only found something about an object variable ? In which situations is such a tag used or beneficial ?

>>Also you could split the class ENTITY into ViewEntity and WorldEntity, so we can differ also in code and it will be much clearer what is used.

this is a good idea, although I'll have to see if this is actually doable (because i don't know if viewEntities and worldEntities are handled that separate)

>>another thing what would be nice: remove all prefixes of the class functions. this looks simply strange. much better would be this:
this has been mentioned multiple times in this thread, and yes it would look much better, but i want to know exactly what method I'm calling and be able to look it up immediately in the gamestudio manual, that's why i think that the actual name of the lite-c method is preferable

Thanks for the feedback laugh


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Page 18 of 23 1 2 16 17 18 19 20 22 23

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1